LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use a dll (compiled using VBasic) as an active X?

Hello,
 
I have to use a function that is in a dll ( compiled using Visual Basic).
To be able to work using this dll in CVI, I have created an Active X controller.
And CVI has generated the function that I want to use (that needs a handle) and three functions to create this handle, the problem is that I can´t create the handle for this active X (dll) using these functions.
The function that I have used is:
HRESULT KMAlg_New_KeyGen (const char *Server,
                               int Support_Multithreading,
                               LCID Locale, int Reserved,
                               CAObjHandle *Object_Handle);
""Use this function to create a new _KeyGen object, and obtain a handle to the object.
If the server application is already running, this function may or may not start another copy of the application.  This is determined by the server application.
You must call CA_InitActiveXThreadStyleForCurrentThread with COINIT_APARTMENTTHREADED if you register any ActiveX event callbacks and want the callbacks to be called from the same thread in which they were registered.  If you do not call CA_InitActiveXThreadStyleForCurrentThread with COINIT_APARTMENTTHREADED your callbacks will be called from a system thread"
 
I think that maybe I am using some parameters that are not correct like,Server(I used NULL and the dll, without a good result)
 
Does anayone know if it is possible to use the function in the dll following these steps and how can I do it? Or other idea to do this?
 
Thanks in advanced.
 
Best regards
 
0 Kudos
Message 1 of 1
(2,933 Views)