I want to use call library function to run my dll which written in C++ builder. However it gives error.
In addition above error details: Labview says:
“ An exception (C0000090) occurred during DllEntryPoint or DllMain in module: C:\Users\MehmetEmin\Desktop\Test\dll_Version.dll”
Error Loading C:\Users\MehmetEmin\Desktop\Test\dll_Version.dll
I don’t know why it doesn’t load or run?
DLL is in a folder on the desktop. C code is in another folder.... What I am doing in Labview is:
Putting this dll into CallLibraryFunction- Function- Library name or path
then under that box there is a function name box, in that box: I have only "__CPPdebugHook" ..... I select it... Actually I didnt give any name like that, it is in the function name box automotically, so I select it....
Then As I said, I added the input parameters and wired them in block diagram....Thats all I did...Finally it gives error....
I know for you its very difficult to solve something from here but I dont know who can help me...
I meant to attach the C code, DLL and LabVIEW VIs. Even if you would write 10 pages of prosa, this can't replace a look at the real thing. Also it may be something with your C Builder project, but there I can't help as I only use Visual Studio.
One thing your last post finally shows, is that your functions seem not to get exported. The DebugHook is a function created by your C Builder to support debugging the DLL, trying to call that from LabVIEW can do nothing but cause exceptions.
You have to mark your functions to get exported. Not sure what C Builders prefered way is, but in Visual C one does this either by prepending __declspec(dllexport) to the function definition or specifying a .def file that lists all exported function names. I'm pretty sure C Builder supports that too, but it may have other additional means too.
Thanks for your reply. You are right, I think problem is about C++ builder..The thing is I don’t know how to make a correct dll in borland C++ builder than can be
seen in Labview.
I checked online example C++ builder dll creation and I found the code in attachment “1”. (http://www.ww.functionx.com/bcb/libraries/staticdll.htm)
I made the dll by following the steps. After that, I was able to see the function name correctly in labview. However, although there wasn’t an error in labview, When I run the labview, it shut down immediately.
Is it because in the above code, more than two returns? Even I leave return “void” in labview, labview closed after running…
I feel pretty pessimistic that if I can’t run above simple code in labview, how will I call long C++ builder code….
I made the dll by following the steps. After that, I was able to see the function name correctly in labview.
_CPPDebugHook is not the function in the C code you show. The function in your DLL is BoxProperties, so it appears the function was not exported. Are you able to load the DLL into another project as that page you linked to shows?
Most likely you just mess up the parameter declaration. The first three parameters should be a double floating point passed by value while the last two should be a double floating point parameter passed by reference (Pass as pointer). If that is not the problem you might have gotten the calling convention wrong. If both of these don't give a result I would throw C Builder out of the Window