LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Labview.lib in Borland

I'm trying to write a dll in Borland for use in LabVIEW, where at a certain point the dll will set an Occurrence.

I've referred to "Setting Occurrences from C in Windows", and followed the instructions. The problem is that I get the error "LABVIEW.LIB contains invalid OMF record, type 0x21 (possibly COFF)". Now I know that this means that the lib was created for Visual C, and not Borland - but what can I do about it? I've tried coff2omf supplied with Borland, but I get a truncated lib file; I would try implib, but I don't have the dll file, only the lib.

Is there a way to convert labview.lib to a format that Borland can use (I'm using BCB 6.0), or is there a borland version of labview.lib available?
0 Kudos
Message 1 of 4
(3,035 Views)
Okay, I've found the solution, which I'll post here for future reference for anyone who comes across the same problem!

The trick is finding that lvrt.dll contains the Occur function (and I assume the other functions in labview.lib). Then it's just a case of using impdef and implib, as described at http://www.bcbdev.com/articles/vcdll.htm
0 Kudos
Message 2 of 4
(3,035 Views)
Latest update: that solution doesn't actually work. It seems to, and everything compiles, but the functions that you call from labview.lib/lvrt.dll return errors, while the exact same code works perfectly under LabWindows/CVI.
0 Kudos
Message 3 of 4
(3,035 Views)
My final update on the subject, just for posterity (and anyone else who comes along later with a similar problem):

It now works, using Borland. The problem was that I didn't create a .lib for lvrt.dll properly: I followed the instructions at http://www.bcbdev.com/articles/vcdll.htm, but in my new .def file I only created an alias for the one function I was interested (Occur), and not all the related functions (such as AllocOccur, etc). Once I recreated the .def file with all the needed aliases, and then recreated my .lib file, everything works perfectly.
0 Kudos
Message 4 of 4
(3,035 Views)