07-26-2010 10:20 AM
Hi,
i'm using a .dll which requires a string of a certain length.
the c++ code in the source of the .dll is:
char buffer[81] = {0};
strncpy(buffer, tagname.c_str(), sizeof(buffer));
m_errorcode = pipt_findpoint(buffer, &pointid);
Got anyone an idea how i can create stings of 81 characters?
Thanks
Solved! Go to Solution.
07-26-2010 10:31 AM - edited 07-26-2010 10:32 AM
Create an array of U8 and then use the Byte Array to String function.
However, your C code seems to imply the memory allocation is being done inside the DLL, rather than in LabVIEW. If so, allocating the string in LabVIEW is rather pointless.
Also, be aware that pure C++ DLLs are not supported by LabVIEW. You may run into name mangling issues. See Writing Win32 Dynamic Link Libraries (DLLs) and Calling Them from LabVIEW and Function Not Found in Library Error When Using the Call Library Function Node.
07-26-2010 10:35 AM
Hi,
Something like that ? Maybe that's not a very smart way to that but it's OK...
Best,
J.
07-26-2010 10:36 AM
Oups sorry I have seen smercurio answer later, the way he did that is better. 🙂