Board index » cppbuilder » DLL vs Lib (to be used in ms vc++ program)

DLL vs Lib (to be used in ms vc++ program)

Hi,

I'm making a program in m$ visual c++ 6, and I'd like to add some interface
stuff (made in bcb5) to it. One way to do this is making a DLL in bcb5 which I
call from the vc program.

Is it also possible to create a static lib (which should contain all the
neccesary vcl stuff, just like the DLL) that can be used in the vc program?

Thanks,
  Rogier

 

Re:DLL vs Lib (to be used in ms vc++ program)


Quote
> Is it also possible to create a static lib (which should contain all the
> neccesary vcl stuff, just like the DLL) that can be used in the vc program?

No, library files are not cross-compiler. You'll have to create a DLL *with
C interfaces* in order to use the BCB code from within a VC++ application.
Of course, Microsoft, in all its wisdom, doesn't provide an implib so you
can generate the import library from the DLL.

You can't use C++Builder's (or Delphi's) implib, as it will generate a Borland
compatible lib, not a Microsoft compatible lib. You'll need to use the equivalent
program for MSVC, but unfortunately, Microsoft doesn't recognize this as a
problem so it no longer has an IMPLIB. I think there is an older version
floating around somewhere, but I haven't found it.

I have found the Knowledge Base article that talks about creating a VC++ compatible
import library from a 3rd party dll:

http://support.microsoft.com/support/kb/articles/q131/3/13.asp

I've also found a small utility that might help:

http://www.mvps.org/win32/misc/makedef.html

+====================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)     |
| Havas Interactive             HyperStudio Engineer |
| http://www.buddydog.org http://www.hyperstudio.com |
+====================================================+

"Whoever said you can't buy happiness forgot about puppies."
 -- Gene Hill

Other Threads