473,386 Members | 1,706 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,386 software developers and data experts.

extern "C" is ignored


Hello,

My DLL (VC 2005, unmanaged) contains an exported function AutoOpen, whose name
should be undecorated. I've used this declaration:

extern "C" __declspec(dllexport) int WINAPI AutoOpen(void)

In spite of extern "C", the name of this function is still decorated in the DLL
(_AutoOpen@0 instead of AutoOpen). Why ?

Thanks !

Sep 26 '07 #1
2 1349
Hi Toto!
extern "C" __declspec(dllexport) int WINAPI AutoOpen(void)

In spite of extern "C", the name of this function is still decorated in
the DLL (_AutoOpen@0 instead of AutoOpen). Why ?
This is the default naming if you choose 'extern "C"'.

If you want other names, you must use a *.def file!

Greetings
Jochen
Sep 26 '07 #2

"Jochen Kalmbach [MVP]" <no********************@holzma.dewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi Toto!
>extern "C" __declspec(dllexport) int WINAPI AutoOpen(void)

In spite of extern "C", the name of this function is still decorated in
the DLL (_AutoOpen@0 instead of AutoOpen). Why ?

This is the default naming if you choose 'extern "C"'.
Well, that is the combination of extern "C" with __stdcall (which is part of
WINAPI). It definitely is not the C++ mangled name, which encodes all
parameters, namespace, and so forth.
>
If you want other names, you must use a *.def file!
Yes, and also allows you to control ordinals, etc.
>
Greetings
Jochen

Sep 26 '07 #3

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

Similar topics

10
by: Mark A. Gibbs | last post by:
I have a question about mixing C and C++. In a C++ translation unit, I want to define a function with internal linkage and C calling convention. Here's a sample of what I want to do: //...
19
by: ccwork | last post by:
Hi all, I am reading "C: A Reference Manual" 4th ed and I get lost for the "extern". It says that global object without specifying the storage-class specifier will have "extern" as the default...
0
by: Lei Jiang | last post by:
I have setup a .NET library in C++ language in VS.NET 2005 Beta1. I this project, I add some additional dependency to some C library. The header file of the C library has been marked as "extern...
5
by: Medvedev | last post by:
What's that preprocessor do #ifdef __cplusplus extern "C" { #endif .. .. .. #ifdef __cplusplus } #endif
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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.