LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call library function node - Delphi DLL

Hi all,

here we have a dll what we want to call from LV.
Unfortunately, the interface information is poor, the code was actually
written in delphi and all the declaration specified calling convention
register...
Well, I know, the stdcall is a must, therefore, if I changed the
declaration I think it could work, but still I have no type information
in LV. So it seems, - having a lots of procedures/functions (cc. 200), -
it's necessary to create a type library to avoid composing the
functions prototype by hand in the CLF dialog.
Under these circumstances to write the IDL script in Delphi is a
nightmare, punching through the TLB Editor...
Any idea how to solve this problem? At least without monkey work...
Is there any tool which converts delphi interface to idl or something
like that?

Thanks in advance for the help
Thomas

0 Kudos
Message 1 of 3
(2,861 Views)


x@no.mail wrote:
Hi all,

here we have a dll what we want to call from LV.
Unfortunately, the interface information is poor, the code was actually
written in delphi and all the declaration specified calling convention
register...
Well, I know, the stdcall is a must, therefore, if I changed the
declaration I think it could work, but still I have no type information
in LV. So it seems, - having a lots of procedures/functions (cc. 200), -
it's necessary to create a type library to avoid composing the
functions prototype by hand in the CLF dialog.
Under these circumstances to write the IDL script in Delphi is a
nightmare, punching through the TLB Editor...
Any idea how to solve this problem? At least without monkey work...
Is there any tool which converts delphi interface to idl or something
like that?


I wouldn't know and I kind of doubt it. Borland hasn't been known to confirm to MS standards other than the absolute necessary to make their apps work under Windows. This might be also because some of the MS standards aren't that great and most software programmers think they can always do better.

Since you are talking about 200 functions I wonder what software that would be? It is usually not very common to write that large libraries only to use them in another environment. And monkey work it may be, but finding a Borland interface description to IDL converter and make that work, get the type lib generated properly from the IDL script, get that type lib integrated into the DLL (the Borland tools probably won't link a .tlb file and the Microsoft linker most likely won't link a Delphi DLL or lib) might be a much bigger challange than biting the bullet.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(2,856 Views)
The problem with C export DLLs is that there is simply no information stored in the DLL about the types to the functions. If you have the source code to the DLL, you might be able to rebuild it and tell Delphi to emit more information (such as a tlb). Unfortunately, I don't know Delphi so I'm not sure what your options are going to be. Another option you might have is to rebuild the DLL using the .NET support built into Delphi - I believe they can create .NET classes. This is like having the tlb, but better, and would allow you to use the .NET interface in LabVIEW to talk to it.
 
If you don't have the source, then I'm afraid I can't think of anything other than using the documentation to hand craft your IDL or Call Library Nodes.
0 Kudos
Message 3 of 3
(2,844 Views)