ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call library function node: passing pointers

I know there are another posts about this issue, but I still have doubts.
I have a function prototype in a dll that is "void StartServer (char *pServerIP, long ServerPort)"
The pServerIP variable is a string. If I add this argument as string, and select "C String Pointer", the prototype on the LabVIEW call library function node is: "void StartServer(CStr pServerIPAddr, long ServerPort)".
It's the first time I use it, and I would like to know if it is the same.
Thank you!!"
0 Kudos
Message 1 of 4
(3,728 Views)
Yes, CStr is equivalent to char *. You can look in extcode.h for the definition of CStr.
0 Kudos
Message 2 of 4
(3,728 Views)
thanks for your answer. where is this file?
I'm having a lot of problems using the Call Library function node. perhaps you can help me...
It's the first time I use it, and I have to call a function developed in C++, and built in a DLL. I haven't develop this dll. When I insert it in my LabVIEW code, LabVIEW is automatically closed. Is there any way to know if the problem is in the dll or in my code? I just pass a string control, and a numeric control to the "Call library function node"...

Thanks!!!!
0 Kudos
Message 3 of 4
(3,728 Views)
It should be in the cintools folder. There is a pdf document "Calling External Code" that should cover all of the details, but I'd guess you are using the wrong calling convention (cdecl or stdcall/WINAPI). Try using the other type of calling convention.
0 Kudos
Message 4 of 4
(3,728 Views)