LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need Developer studio (C++ programming language) in my computer when I call a dll through my labview?

Solved!
Go to solution

Okay Sir,

 

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”

 

and

 

Error Loading C:\Users\MehmetEmin\Desktop\Test\dll_Version.dll

 

I don’t know why it doesn’t load or run?

 

Regards,

0 Kudos
Message 11 of 48
(1,429 Views)

And where is the C code, DLL and LabVIEW VIs? I can do a lot but not really guess what you did, and how and all that.

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 48
(1,421 Views)

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...

 

 

Regards.... 

0 Kudos
Message 13 of 48
(1,418 Views)
For some reason, you marked your question as accepted solution. Please undo and pick the best answer. Thanks!
0 Kudos
Message 14 of 48
(1,415 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 15 of 48
(1,413 Views)

These are pictures from my labview window......

Download All
0 Kudos
Message 16 of 48
(1,399 Views)

 


@yemin wrote:

These are pictures from my labview window......


You did read my entire answer, right?????

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 17 of 48
(1,375 Views)

Dear Rolf,

 

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….

Regards,

0 Kudos
Message 18 of 48
(1,353 Views)

 


yemin wrote:  

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?

 

0 Kudos
Message 19 of 48
(1,332 Views)

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 Smiley Wink

Rolf Kalbermatter
My Blog
0 Kudos
Message 20 of 48
(1,329 Views)