Board index » delphi » Using Delphi 2.0 DLL in Visual C++ 4.1 EXE

Using Delphi 2.0 DLL in Visual C++ 4.1 EXE

I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
program created with Visual C++ 4.1.

I have to created a .LIB file to do it, but I can't find a utility to create a
LIB file from the DLL.  I've checked Delphi and VC++ for a util.

Anybody got any hints?

/===================================================\
| John Simmons (Redneck Techno-Biker)               |
| j...@connectnet.com                                |
| http://www2.connectnet.com/users/jms/index.html   |
|===================================================|
| IGN #12 Zerex American Eagle Motorsports Ford     |
| http://www2.connectnet.com/users/jms/aemmain.html |
| Hawaii NickName - AEMwest                         |
|===================================================|
| 93 FLSTC - 54,000 miles and counting                      |
| Harley Scum Biker (tm) #14                                            |
\===================================================/

 

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


Quote
John Simmons wrote:

> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
> program created with Visual C++ 4.1.

> I have to created a .LIB file to do it, but I can't find a utility to create a
> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

> Anybody got any hints?

You checked out the lib utility?

- Alf

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


Quote
John Simmons wrote:

> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
> program created with Visual C++ 4.1.

> I have to created a .LIB file to do it, but I can't find a utility to create a
> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

> Anybody got any hints?

You don't need no LIB file.  All you have to do is go to View|Project Source,
then replace the keyword program with library, create export clauses for all
functions that you want to export (don't forget to specify the correct calling
convention), and Delphi will create the DLL for you.  Make sure to read the
Delphi documentation about DLL's before diving into this.

-- ##  Jensi - MOD4WIN development team - mailto:jpuch...@mailbox.syr.edu  ##
   ##  JSInc.   -   P.O. Box 6173   -   Syracuse, NY 13217-6173   -   USA  ##
   ##  for latest infos/news/updates visit http://www.kosmic.org/mod4win/  ##

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


In article <31A9E448.2...@online.no>, "Alf P. Steinbach" <al...@online.no> wrote:

Quote
>John Simmons wrote:

>> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
>> program created with Visual C++ 4.1.

>> I have to created a .LIB file to do it, but I can't find a utility to create
> a
>> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

>> Anybody got any hints?

>You checked out the lib utility?

If you're referring to the one that came with VC++, yeah, I did.  The help is
a couple of paragraphs and isn't real helpful.  Borland used to ship IMPLIBW
with its compilers, but doesn't any longer.

/===================================================\
| John Simmons (Redneck Techno-Biker)               |
| j...@connectnet.com                                |
| http://www2.connectnet.com/users/jms/index.html   |
|===================================================|
| IGN #12 Zerex American Eagle Motorsports Ford     |
| http://www2.connectnet.com/users/jms/aemmain.html |
| Hawaii NickName - AEMwest                         |
|===================================================|
| 93 FLSTC - 54,000 miles and counting                      |
| Harley Scum Biker (tm) #14                                            |
\===================================================/

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


Quote
John Simmons (j...@connectnet.com) wrote:

: In article <31A9E448.2...@online.no>, "Alf P. Steinbach" <al...@online.no> wrote:
Quote
: >John Simmons wrote:

: >>
: >> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
: >> program created with Visual C++ 4.1.
: >>
: >> I have to created a .LIB file to do it, but I can't find a utility to create
: > a
: >> LIB file from the DLL.  I've checked Delphi and VC++ for a util.
: >>
: >> Anybody got any hints?
: >
: >You checked out the lib utility?

: If you're referring to the one that came with VC++, yeah, I did.  The help is
: a couple of paragraphs and isn't real helpful.  Borland used to ship IMPLIBW
: with its compilers, but doesn't any longer.

Can TDUMP.EXE do this? (I've no idea, thought it's worth
a shot.)

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


Quote
John Simmons wrote:

> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
> program created with Visual C++ 4.1.

> I have to created a .LIB file to do it, but I can't find a utility to create a
> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

> Anybody got any hints?
> {SNIP}

I have the last version of Borland C++ and it still ships with IMPLIB.  
I don't have VC++ 4.1, but I'm sure it also ships with IMPLIB.  

If all else fails, I guess you could use the IMPORTS mechanism in your
.def file, but I don't like that method myself.

Good luck,
Blake Schwendiman

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


Quote
In article <31AA8AD2.4...@mailbox.syr.edu>, Jensi <jpuch...@mailbox.syr.edu> wrote:
>John Simmons wrote:

>> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
>> program created with Visual C++ 4.1.

>> I have to created a .LIB file to do it, but I can't find a utility to create
> a
>> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

>> Anybody got any hints?

>You don't need no LIB file.  All you have to do is go to View|Project Source,
>then replace the keyword program with library, create export clauses for all
>functions that you want to export (don't forget to specify the correct calling
>convention), and Delphi will create the DLL for you.  Make sure to read the
>Delphi documentation about DLL's before diving into this.

Read my original post again.  I said that I *already* have the DLL compiled.  
I need to create a LIB file (whether you think I do or not).  So, knowing
these two facts, can anybody tell me how to make a LIB file for this DLL so I
can link it into my C++ program?

/===================================================\
| John Simmons (Redneck Techno-Biker)               |
| j...@connectnet.com                                |
| http://www2.connectnet.com/users/jms/index.html   |
|===================================================|
| IGN #12 Zerex American Eagle Motorsports Ford     |
| http://www2.connectnet.com/users/jms/aemmain.html |
| Hawaii NickName - AEMwest                         |
|===================================================|
| 93 FLSTC - 54,000 miles and counting                      |
| Harley Scum Biker (tm) #14                                            |
\===================================================/

Re:Using Delphi 2.0 DLL in Visual C++ 4.1 EXE


We spent a couple of hours figuring this out last week.  First create
a DEF file and then use VC++ LIB utility to create the LIB.  Something
like LIB /IMPORT:MYFILE.DEF /OUT:MYFILE.LIB.  I used the
BC++ IMPDEF utility to create the DEF file - I'm not sure what
equivalent there is in Delphi or VC++.  If you do have BC++, don't use
IMPLIB to create the LIB - VC++ won't recognize it.  

Mark.

---------------------------------------------------------------------------------------------------

Quote
j...@connectnet.com (John Simmons) wrote:

In article <31A9E448.2...@online.no>, "Alf P. Steinbach"

Quote
<al...@online.no> wrote:
>John Simmons wrote:

>> I've got a DLL creating with Delphi 2.0, and I'd like to use this DLL in a
>> program created with Visual C++ 4.1.

>> I have to created a .LIB file to do it, but I can't find a utility to create
> a
>> LIB file from the DLL.  I've checked Delphi and VC++ for a util.

>> Anybody got any hints?

>You checked out the lib utility?

If you're referring to the one that came with VC++, yeah, I did.  The
help is
a couple of paragraphs and isn't real helpful.  Borland used to ship
IMPLIBW
with its compilers, but doesn't any longer.

/===================================================\
| John Simmons (Redneck Techno-Biker)               |
| j...@connectnet.com                                |
| http://www2.connectnet.com/users/jms/index.html   |
|===================================================|
| IGN #12 Zerex American Eagle Motorsports Ford     |
| http://www2.connectnet.com/users/jms/aemmain.html |
| Hawaii NickName - AEMwest                         |
|===================================================|
| 93 FLSTC - 54,000 miles and counting                      |
| Harley Scum Biker (tm) #14                                            |
\===================================================/

Other Threads