LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing C Struct from Test Stand to LabWindows/CVI, throwing Error

Hi All,

 

I'm using Labwindows/CVI 8.5 & Test stand 3.5. when I try to pass Test stand C Struct to labwindows, getting the following error in Test stand.

 

Error Info :

 

Expected instance of type structReadConfig, passed object without type.
Error in parameter 1, 'pConfig'.

 

-17311; Could not accept the parameters passed in.

 

Request you all to assist me in solve this issue.

 

Thanks

G'Ramy

0 Kudos
Message 1 of 4
(3,387 Views)

Structs in C can be passed by value or by reference.

 

Looks like maybe you're trying to pass a struct by reference when a pointer to a struct is expected?

 

Then again, normally you'd get a compile time error if you're calling a function in a DLL from code using a header filefor the DLL and the corresponding DLL library.

 

If there's some sort of dynamic binding happening then it's more likely that you could get crossed up on the struct passage by value / by reference.

 

Menchar

0 Kudos
Message 2 of 4
(3,338 Views)

Hi menchar,

 

Thanks for your reply.

 

In Test stand 3.5, there is no separate options for by Reference & by Pointer. Please see the attached screenshot.

 

In Dll side (LabWindows/CVI), my API declaration is like below,

 

void __declspec(dllexport) __stdcall Lib_Hdom_GetAllConfig( struct structReadConfig *pConfig,
                                                                                         short *errorOccurred,  long *errorCode,  char *errorMsg);

 

help me in solving this.

 

Thanks

G'Ramy

 

 

 

 

0 Kudos
Message 3 of 4
(3,312 Views)

Hi menchar,

 

Thanks for your reply.

 

In Test stand 3.5, there is no separate options for by Reference & by Pointer. Please see the attached screenshot.

 

In Dll side (LabWindows/CVI), my API declaration is like below,

 

void __declspec(dllexport) __stdcall Lib_Hdom_GetAllConfig( struct structReadConfig *pConfig,
                                                                                         short *errorOccurred,  long *errorCode,  char *errorMsg);

 

help me in solving this.

 

Thanks

G'Ramy

 

 

 

 

0 Kudos
Message 4 of 4
(3,311 Views)