LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX controller methods import as callbacks

Your new FP file worked!!!  I can't thank you enough for working on this.  I was going to use a Visual Basic .NET program as a bridge and pass it commands via local TCP/IP.  This is going to be much easier!

 

Just as a follow up, I should mention that the code I pasted before called the wrong function to open the connection.  Here's the corrected code using the new ...Code command in the FP:

 

    CAObjHandle MachHandle;
    CAObjHandle ScriptObjectHandle;

    Mach4_ActiveIMach4 ("c:\\Mach3\\Mach3.exe", 1, LOCALE_NEUTRAL, 0, &MachHandle);
    Mach4_IMach4GetScriptDispatch (MachHandle, NULL, &ScriptObjectHandle);
    Mach4_IMyScriptObjectCode (ScriptObjectHandle, NULL, "G20 x-1 z-1 y-1");

 

I don't know enough about ActiveX servers to comment on your remark about the server not being defined correctly.  However, I have some additional information that might be interesting.

 

I worked with a Microsoft engineer on the Visual Basic interface.  He introduced me to a tool called  Reflector that lists all the interfaces for an ActiveX server.  When I open Mach4 in Reflector, it shows the following:

 

 Reflector screen shot.jpg

 

As you can see, all the functions show up under the IMyScriptObject interface.  There's another interface named IMyScriptObject_Event which contains events for all those functions, too:

 

 Reflector screen shot 2.jpg

 

 I wonder if there's an issue when CVI creates an FP for an ActiveX server which contains multiple interfaces?

0 Kudos
Message 21 of 21
(1,398 Views)