LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL build with LabVIEW 6.0.2 and called from MS VC++ 6 will generate the error "LABVIEW.LIB was not called from a LabVIEW process".

I created a DLL with LV 6.0.2. A function in this DLL uses the "Open Serial Driver.vi".
I created an application with MS VC++ 6 which calls this function. Then I get a MSG Box with the above mentioned error and the application exits. I have the EXE, the DLL and serpdrv in the same directory.
I'm running windows NT4.0 SP5/6 german and english versions. The serpdrv is from 2000/06/20.
One the same machines I have also LV 5.0.1 and LV 5.1.1 installed. I hope there will be no cross impacts for my problem.
The KB Article 203EA3XC doesn't answer the question, because "Open serial driver.vi" is delivered from NI with LabVIE
W 6.x.
Calling the DLL functions from LabVIEW will work fine.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 1 of 4
(2,843 Views)
I think there's actually a knowledge base about this one. Try typing "+labview.lib" into the knowledge base search string. Any Windows DLL or CIN built with a version of cintools before version 6.0 must be relinked with the labview.lib from 6.0 in order to work when called from a DLL built with LabVIEW. This is most likely what your problem is.
0 Kudos
Message 2 of 4
(2,843 Views)
The article from KB is the one I mentioned in my question. It is interesting that that article was updated the day after your answer. Are there really old VIs delivered with LabVIEW 6.x?
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 4
(2,843 Views)
For all coming across this article.

Meanwhile I have found the solution:
First you must use the VISA serial driver functions and not the serpdrv based functions. Some have found the serpdrv function will do in LV 7.0. Thats not really true since LV 7.0 doen't have the serpdrv mechanism. LV 7.0 is providing a interface for upgrading but internal it will use VISA. For this fact look into the upgrade notes.

Second you need to use the delay load feature if you are using MS Visual C++ 6.0. The dealy load feature is a option in the linker settings.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 4
(2,843 Views)