The problem here is that the default interface in the event CoClass did not have any methods and properties, which is not common practice. CVI detects this and does not generate any of the event registration functions of this because it thinks there is no way to instantiate the object. So the workaround for this was to take the idl, and add a DoNothing method in the _Events interface. I am attaching the idl and the tlb file for this so you can regenerate the function panel. You will need to use the tlb file to generate the fp.
I must say this is the first time I have seen a type library like this one. The way it's set up is very unusual, which is why you are seeing all these different issues with it.
I tested it with the following code snippet
static CAObjHandle hATS2Object;
static ATSObj_IApplication appObjHandle;
static CAObjHandle globalObjHandle;
HRESULT CVICALLBACK OnError (CAObjHandle caServerObjHandle,
void *caCallbackData,
long errorCode)
{
return 0;
}
int main (int argc, char *argv[])
{
ATSObj__Events hEvents;
HRESULT status;
ATS2Obj_IAGen hiagenHandle;
status = ATS_New_RabbitGlobal (NULL, 1, LOCALE_NEUTRAL, 0, &globalObjHandle);
status = ATS__RabbitGlobalEvents(globalObjHandle,0,&hEvents);
status = ATS__EventsEventsRegOnOnError(hEvents,OnError,0,1,0);
status = ATS2_New_ATS2Global (NULL, 1, LOCALE_NEUTRAL, 0, &hATS2Object);
status = ATS2__ATS2GlobalAGen(hATS2Object,0,&hiagenHandle);
status = ATS2_IAGenSetAmpl(hiagenHandle,0,ATS2Const_apbChA,"Vrms",111.9);
I hope this helps
Bilal Durrani
NI