LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

activeX "Handle is not valid" error with VB DLL

HI,
I have created an activeX controller using the tool in CVI 7.0 for a DLL I recv'd written in VB.
Here is the code:

status = Vl_New_SQL (NULL, 0, LOCALE_NEUTRAL, 0, &objectHandle);
status = Vl__SQLLogin (objectHandle, NULL, *cdsid[0], *pword[0], &successful);
status = Vl__SQLGetLocalIPAddress (objectHandle, NULL, *arg1);

//I can call the some 25 calls like above without a problem even though the objectHandle doesn't change value
//but as soon as I call this one I get an "The Handle is invalid" Error (NULL's are optional cmds)

status = Vl__SQLReturnSQL (objectHandle, &ErrInfo, 3, "TSCODE::A", &dataArray, NULL, NULL, NULL, NULL);

//status = -2147024890

Any suggestions?

thanks!
mike
0 Kudos
Message 1 of 2
(2,941 Views)
Hi mike,

The only thing I could think of is if you're invalidating the handle with some other call like a close. Does the value of the object handle change when you break just before making the call to ReturnSQL? Also, is the parameter for ReturnSQL supposed to be an object handle, or is it another handle, to say a sql statement? I would check those things first to be sure you're sending the correct handle the function. Other than that, I'd verify that the code works in another development environment. Hope this helps!
Jeremy L.
National Instruments
0 Kudos
Message 2 of 2
(2,927 Views)