06-27-2011 01:30 AM
Hi there,
I have created an ActiveX-Object that exposes a method for creating other objects by name and that would return a pointer to the interface I also specify. In C++, this works perfectly - the function declaration looks like this (IDL): HRESULT GetSubSystem([in] BSTR aName, [in] REFIID IId, [out,retval] IUnknown** aInterface);
I have also succeeded in creating this object with LABView, but when I try to create the invoke-method node from the object, this method name is grayed out. Therefore it seems that I have no chance to call this function. Is this by intention, or am I doing something wrong ??
As a workaround I added another function, that would accept the Interface Id as a String (IDL-function declaration): HRESULT GetSubSystemEx([in] BSTR aName, [in] BSTR InterfaceId, [out,retval] IUnknown** aInterface); Now using this method in LABView works as expected, but this brings in another issue:
Can I convert the output on an AutomationRefnum-Node to a String that contains the GUID of that Refnum ??
Anyone some suggestions ? Thanks for any help !
08-08-2011 06:25 AM
Hi,
for your work around (also for your primer solution) you need a method to call the value from your activeX object...
LabVIEW works by exchanging datas by value, but you are doing this be references within this activeX call.
I would suggest you to change your activeX component (if it is possible) from "pass by reference" to "pass by value"
or later to integrate a invoke node where you can call the value stored by the provided address...
Hope this helps you!