Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

"The Handle is Invalid" When trying to access DLL function

$
0
0

Hello All,

 

I uploaded an ActiveX Controller to access a Barometer DLL, of which im trying get pressure data.

 

HRESULT    error1=0;

HRESULT    error2=0;
HRESULT    error3=0;
HRESULT    error4=0;

CAObjHandle val0=-1;

 

//HRESULT CVIFUNC BarometerClientDLL__BarometerClientSetserverName (CAObjHandle objectHandle, ERRORINFO *errorInfo, const char *pRetVal);

error1 =  BarometerClientDLL__BarometerClientSetserverName (val0, NULL, IP_ADDRESS);

 

//HRESULT CVIFUNC BarometerClientDLL__BarometerClientSetserverSocket (CAObjHandle objectHandle, ERRORINFO *errorInfo,long pRetVal); 
error2 =  BarometerClientDLL__BarometerClientSetserverSocket (val0, NULL, PORT_NUM);

 

//HRESULT CVIFUNC BarometerClientDLL__BarometerClientreconnect (CAObjHandle objectHandle, ERRORINFO *errorInfo, VBOOL *pRetVal);
error3 =  BarometerClientDLL__BarometerClientreconnect (val0, NULL, retVal0);

 

//HRESULT CVIFUNC BarometerClientDLL__BarometerClientGetpsia (CAObjHandle objectHandle,ERRORINFO *errorInfo,double *pRetVal);  
error4 =  BarometerClientDLL__BarometerClientGetpsia (val0, NULL, retVal);

 

 

 

 

The code compiles fine, but after each of the above lines execute, the error1-4 is set to -214702890 and the value in reads: {0x80070006="The handle is invalid."}

 

The Barometer DLL doesnt need any parameters or UI control so I tried setting the Object Handle to 0, and Error Info to NULL, I wasnt able to find much info on this error anywhere online and I am not using TestSteps.

 

Thank you for help


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>