Prev: A exception occured when I calling the dll created inLabVIEW8.2 from my VB.NET 2005 application.
Next: Make C# module for labview
From: Louis Ferreira on 20 Jun 2007 12:10
I have Animatics SmartMotors and am using their SMIEngine.dll, which is a COM dll. I'm having trouble with a particular interface called ISMICMotion. The help information for obtaining an instance of it is as follows: The client application
can obtain an instance of this interface, using the available <a href="../ISMIComm/ISMIComm%20Interface.htm" target="_blank">ISMIComm</a> interface. The following examples show how to obtain
this interface in Visual Basic and Visual C++.
In these examples CommInterface is assumed to be the available <a href="../ISMIComm/ISMIComm%20Interface.htm" target="_blank">ISMIComm</a>
CMotionInterface As ISMICMotion Set
CMotionInterface = CommInterface
ISMICMotionPtr CMotionInterface; HRESULT
\"ISMICMotion\" not found!"); return; }I can open a reference to the ISMICMotion interface using Automation Open but the operation of the methods from the ISMICMotion interface is dependent on the ISMIComm interface. So opening an independent reference doesn't work and the ISMIComm interface does not have anything like a GetISMICMotion reference method. Is there any way to achieve in LabVIEW what the above code does?
It seems to me that I should be able to acquire proper dependencies using only the exposed methods. Is it because the makers of the SMIEngine.dll have not followed some COM rules?thanks for you help,Louis
From: Yi Y on 21 Jun 2007 18:40
From the example code that you provided, I do not see the portion as to
how to acquire the ISMIComm interface or if it's accessible. You would need ISMIComm to access ISMICMotion interface. LabVIEW can only access references and call methods that are exposed. From what I can gather based on the code, you need to get the reference for ISMIComm interface, find the method that gives you a reference to ISMICMotion interface, then get the reference for CommInterface, access QueryInterface method, then pass the reference to ISMICMotion as a parameter to QueryInterface. I cannot tell you how SMIEngine.dll is implimented, and it would be difficult for me to say exactly how the operation is done without familiarity with the implementation of your driver.Hope this information helps. Feel free to post here if you need any clarifications.Yi YanApplications Engineeringwww.ni.com/support