12-04-2015 08:44 AM
Hi, I built a dll in C++ to write data to a shared data segment, and it works well in Labview. Then I try to call the Dll in C++, it can be successfully built but will break in the end. I have been in this problem for almost a whole day and couldn't find the solution.
Below is the source files of my Dll and dynamically calling program.
Dll:
Calling program.
Solved! Go to Solution.
12-04-2015 08:55 AM - edited 12-04-2015 08:56 AM
So, now you want people to help you with C++ calling a C++ DLL problem here on a LabVIEW message board?
12-04-2015 09:12 AM
Your Store subroutine indicates e is an array of 7 elements.
Your calling subroutine passes the address of the last element in the array (&e[7]). Try &e[0].
12-04-2015 10:37 AM
thank you for your reply as I know the question is not very "Labview". I changed the array address like you said and the problem is still there. Attached is my calling program and dll, could you have a look at it for me please?
12-06-2015 10:47 AM
For C/C++ issue, you would be better help in the LabWindows/CVI group:
http://forums.ni.com/t5/LabWindows-CVI/bd-p/180
12-07-2015 12:42 PM
Problem solved. The working dll for both C++ and Labview should be like this. The shared data segment should also be declared like funtion and with "extern "C"" ahead. In addition, Labview can only read pointers from dll.