BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calling a C++ Builder DLL from VC++

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC)
View previous topic :: View next topic  
Author Message
Harish
Guest





PostPosted: Wed Jun 28, 2006 4:35 pm    Post subject: Calling a C++ Builder DLL from VC++ Reply with quote



I have a DLL written in BC++ 6.0. All the exported functions from the DLL are extern "C". I need to call it from VC++ 6.0. How can I generate the import library to the DLL?
Back to top
Ed Mulroy
Guest





PostPosted: Wed Jun 28, 2006 9:06 pm    Post subject: Re: Calling a C++ Builder DLL from VC++ Reply with quote



You can use Microsoft tools to create a Microsoft format import library.

As an alternative you can use implib.exe to create a module definition file
and use that with BC++.

This is not an exotic solution. Import libraries are merely a library
format way to bundle up part of what has been historically done with module
definition files.

.. Ed

Quote:
Harish wrote in message
news:44a2696b$1 (AT) newsgroups (DOT) borland.com...

I have a DLL written in BC++ 6.0. All the exported functions
from the DLL are extern "C". I need to call it from VC++ 6.0.
How can I generate the import library to the DLL?
Back to top
Harish
Guest





PostPosted: Fri Jun 30, 2006 8:10 am    Post subject: Re: Calling a C++ Builder DLL from VC++ Reply with quote



Thanks, Ed Mulroy, but I'm afraid I cannot do it.
First, which MS tools should I use?
Second, I can call a VC++ created DLL from BC++ (using the BC++ provided fantastic implib tool). But I want to call a BC++ created DLL from VC++. Could you plz give a more specific solution?
-Harish

"Ed Mulroy" <dont_email_me (AT) bitbuc (DOT) ket> wrote:
Quote:
You can use Microsoft tools to create a Microsoft format import library.

As an alternative you can use implib.exe to create a module definition file
and use that with BC++.

This is not an exotic solution. Import libraries are merely a library
format way to bundle up part of what has been historically done with module
definition files.

. Ed

Harish wrote in message
news:44a2696b$1 (AT) newsgroups (DOT) borland.com...

I have a DLL written in BC++ 6.0. All the exported functions
from the DLL are extern "C". I need to call it from VC++ 6.0.
How can I generate the import library to the DLL?

Back to top
Ed Mulroy
Guest





PostPosted: Mon Jul 03, 2006 10:49 pm    Post subject: Re: Calling a C++ Builder DLL from VC++ Reply with quote

It has been so long since I did this with a Microsoft tool that I had to ask
about it. Remy Lebeau suggested this link and it seems to answer your
question.

http://tinyurl.com/llgon
or, in its long form
http://web.archive.org/web/20031207213941/http://bcbdev.com/articles/bcbdll.htm#example1

.. Ed

Quote:
Harish wrote in message
news:44a4a98a$1 (AT) newsgroups (DOT) borland.com...

Thanks, Ed Mulroy, but I'm afraid I cannot do it.
First, which MS tools should I use?
Second, I can call a VC++ created DLL from BC++ (using the
BC++ provided fantastic implib tool). But I want to call a BC++
created DLL from VC++. Could you plz give a more specific
solution?
Back to top
Ron Sawyer
Guest





PostPosted: Sun Jul 16, 2006 3:19 am    Post subject: Re: Calling a C++ Builder DLL from VC++ Reply with quote

I have never found a tool to allow me to do this. I end up making a dummy
dll in Visual C++ with stubs for functions and compile it to create the
import lib.

"Harish" <cshavadhani (AT) yahoo (DOT) com> wrote in message
news:44a2696b$1 (AT) newsgroups (DOT) borland.com...
Quote:

I have a DLL written in BC++ 6.0. All the exported functions from the DLL
are extern "C". I need to call it from VC++ 6.0. How can I generate the

import library to the DLL?
Back to top
Olivier Bertini
Guest





PostPosted: Sun Jul 16, 2006 5:26 am    Post subject: Re: Calling a C++ Builder DLL from VC++ Reply with quote

Harish a écrit :
Quote:
I have a DLL written in BC++ 6.0. All the exported functions from the DLL are extern "C". I need to call it from VC++ 6.0. How can I generate the import library to the DLL?

Can't you use a def file? def files are created with impdef.exe from
Borland.

eg: impdef -a deffile.def dllname.dll

(I am not sure about the -a parameter)

The accepted format from MS is something like that:

LIBRARY <Name to use inside DLL>
DESCRIPTION "<Description>"
EXPORTS
<First export> @1
<Second export> @2
<Third export> @3
...

For an example, .def file will look like this:

LIBRARY EasyDLL
DESCRIPTION "Does some sphere stuff."
EXPORTS
GetSphereSAandVol @1


The MS LINK option is /def:".\deffile.def"


alternatively you can try to generate a .lib import library once you
have the .def file:

LINK /LIB /MACHINE:x86 /def:defflie.def /out:dllname.lib /name:dllname.dll


I suggest you have a look at these both links:

http://groups.google.ch/group/borland.public.cpp.ide/browse_thread/thread/9f5dc890ee4691e5/246263cf9bbd13ef?lnk=st&q=using+def+files+with+visual+c&rnum=17&hl=fr#246263cf9bbd13ef

http://groups.google.ch/group/borland.public.cppbuilder.non-technical/browse_thread/thread/73fe0ea26f2dfcbf/682d7471a8f63e74?lnk=st&q=using+def+files+with+visual+c&rnum=25&hl=fr#682d7471a8f63e74



I know this isn't a clear answer but I am sure you can start from here.

Olivier
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.