LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS Visual C++ 5 DLL

Hello,
I'm trying to call, from LV VIs, some of my DLL developped with Visual C++
5.0.
And I have always a LV error : "DLL function call error: function not found
in the library".

I downloaded an example from LV Web yesterday (CVI+to+LV.zip), which
contains the C-source of the DLL.
I created a VC5 workspace for a WIN32 DLL where I inserted these C-source
files and I compiled the DLL. After I replaced in the LV diagramm the DLL
called whith the one I compiled and I had the same error message.

Has somebody an example of a DLL with its VC4 or VC5 workspace which can be
called from a LV VI?

Thanks to Help me.
0 Kudos
Message 1 of 3
(4,024 Views)
When using C++ the function names get mangled in the dll after compilation
e.g extra characters get added to the function name. You can use the quick
view utility to see what the "new" function names are and use those in your
LabVIEW call to the dll. If you did not use any C++ functionality I would
reccomend renaming your source file to .c instead of .cpp and recompile as C
code only. This will preserve the original name of you embedded functions.
One other thing after making any changes to a C++ dll the function names
will be different.


Brice Chatelan wrote in message <7mesig$qlu$1@minus.oleane.net>...
>Hello,
>I'm trying to call, from LV VIs, some of my DLL developped with Visual C++
>5.0.
>And I have always a LV error : "DLL function call error: function not fou
nd
>in the library".
>
>I downloaded an example from LV Web yesterday (CVI+to+LV.zip), which
>contains the C-source of the DLL.
>I created a VC5 workspace for a WIN32 DLL where I inserted these C-source
>files and I compiled the DLL. After I replaced in the LV diagramm the DLL
>called whith the one I compiled and I had the same error message.
>
>Has somebody an example of a DLL with its VC4 or VC5 workspace which can be
>called from a LV VI?
>
>Thanks to Help me.
>
0 Kudos
Message 2 of 3
(4,024 Views)
> And I have always a LV error : "DLL function call error: function not found
> in the library".
>

This is almost always called by mangling of function names. If you haven't
turned off the mangling option, VC will insert @, _, and other characters
into the name. That really doesn't matter as long as you can type those
into the LV Call Lib dialog box, but it is probably easier to turn off the
settings when building the DLL. The other thing that can happen of course,
is that the files are mangled to C++ function names which are huge. You
may try putting extern "C" around your .c file contents and try that.

Greg McKaskle
0 Kudos
Message 3 of 3
(4,019 Views)