473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dlls in VC++ and BCB

Hey all,
I have come across the following issue. I have an application written
with Borland C++ Builder, this application loads dlls(plug-ins)
dynamically during run time. To make things easier for my users, I am
trying to make it possible for them to create dlls in C++ Builder
(which works great) and VC++. I tried to use the same code in VC++
builder, which compilled fine, but during runtime I came across a
problem. First of all, this is how I load my DLLS in the host app:

LibAddress = LoadLibrary("C:\\Development\\VC++
DLL\\Release\\DLL.dll");
Connect = (TConnect) GetProcAddress(mydll->LibAddress,"_Connect);
//trying to get a function from the dll
now, in my DLL I export the function Connect the following way in
both dlls:
#define DLL_MODE __declspec(dllexport)
extern "C" void DLL_MODE Connect(TUser*User);
now, this works fine with the BCB dll, but loading the function with
GetProcAddress from the VC++ returned NULL. Using Dumpbin on the DLL
showed that the function was exported as Connect not as _Connect.
Changing the function to look for Connect instead of _Connect worked,
but why is this? Is there a way to get VC++ to report the name
correctly?

thank you

Seabass
Jul 19 '05 #1
4 5609

"Seabass" <sb******@ww-ei.nl> wrote in message
news:f9**************************@posting.google.c om...
Hey all,
I have come across the following issue. I have an application written
with Borland C++ Builder, this application loads dlls(plug-ins)
dynamically during run time. To make things easier for my users, I am
trying to make it possible for them to create dlls in C++ Builder
(which works great) and VC++. I tried to use the same code in VC++
builder, which compilled fine, but during runtime I came across a
problem. First of all, this is how I load my DLLS in the host app:


Please see:

http://www.slack.net/~shiva/welcome.txt

which will inform you that none of 'Borland C++ Builder',
'DLL' or 'VC++' are topical here. Only the ISO standard
C++ language is.

There are already newsgroups for those two compilers,
and for Windows programming issues, where people who
are very knowledgable about such things are just
waiting to help you with these issues.

See www.groups.google.com and/or www.usenet.org
to find which groups are for which topics.

Also the Borland and Microsoft web sites
( www.borland.com ), ( www.microsoft.com )have
links to groups about their products and technologies.

Good luck.

-Mike
Jul 19 '05 #2
Why do you expect the symbol to be exported as "_Connect"?

After an admittedly cursory glance at your code, I'd expect the symbol to be
exported as "Connect" (as you report VC++ does).
In article <f9**************************@posting.google.com >,
sb******@ww-ei.nl (Seabass) wrote:
Hey all,
I have come across the following issue. I have an application written
with Borland C++ Builder, this application loads dlls(plug-ins)
dynamically during run time. To make things easier for my users, I am
trying to make it possible for them to create dlls in C++ Builder
(which works great) and VC++. I tried to use the same code in VC++
builder, which compilled fine, but during runtime I came across a
problem. First of all, this is how I load my DLLS in the host app:

LibAddress = LoadLibrary("C:\\Development\\VC++
DLL\\Release\\DLL.dll");
Connect = (TConnect) GetProcAddress(mydll->LibAddress,"_Connect);
//trying to get a function from the dll
now, in my DLL I export the function Connect the following way in
both dlls:
#define DLL_MODE __declspec(dllexport)
extern "C" void DLL_MODE Connect(TUser*User);
now, this works fine with the BCB dll, but loading the function with
GetProcAddress from the VC++ returned NULL. Using Dumpbin on the DLL
showed that the function was exported as Connect not as _Connect.
Changing the function to look for Connect instead of _Connect worked,
but why is this? Is there a way to get VC++ to report the name
correctly?

thank you

Seabass

Jul 19 '05 #3
Ah okay,
I was just used to BCB exporting it using the standard C calling
convention (with that extra underscore). A friend of mine pointed out
that this doesn't apply to VC++ and that I should make sure it uses
the Standard Call Convention __stdcall. =)
thank you for your reply
Jul 19 '05 #4
"Seabass" <sb******@ww-ei.nl> wrote in message
news:f9**************************@posting.google.c om...
Ah okay,
I was just used to BCB exporting it using the standard C calling
convention Standard C does not have a 'calling convention'.
(with that extra underscore). A friend of mine pointed out
that this doesn't apply to VC++ and that I should make sure it uses
the Standard Call Convention __stdcall. =)


Standard C has nothing called '__stdcall', without or without
the underscores.

'stdcall' is a Microsoft invention.
-Mike
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ack | last post by:
Hii all, I have a this internal use portal i am working on deployed on a server. My app uses some dlls that are instantiated from the asp pages using server.createobject Now I want to deploy...
1
by: Anna | last post by:
Hi, I'm using VS.NET 2003 on Win2000 (SP3). I am trying to import a dll developed in VC++6.0 into my VC.net project. I keep getting linker errors complaining about GetThisClass and...
11
by: Devender Khari | last post by:
Hi Friends, I'm facing a situation as follows, need help on identifying possible issues. There is an MFC application developed in VC6.0, say ABCVC6.exe and another developed in VC.NET, say...
2
by: | last post by:
I try to build dll in VC .NET, In that project I use dlls that were built in VC6, and I get a lot of errors. (for example <iostream.h> instead of <iostream> etc.) I am not aloud to change anything...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
9
by: yevvi | last post by:
Hi, We have a product with bunch of dlls which are now built with Visual Studio 2003. We want to switch the build to use VS2005. I have read that in VS2005 runtime libraries come as...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
4
by: swapna_munukoti | last post by:
Hi all, I am new to .net and that c#. I am currently working for a project that includes migration from vb6 application to c#. VB6 application communicates with a modules developed in VC++. ...
2
by: =?Utf-8?B?c2hpdmE=?= | last post by:
Hi, I have some VC++ COM DLLs and want to reuse the same DLLs in C#.net application with Add Reference but I have a requirement for my application that therre should not be any DLLs for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.