I am writing code for creating DLL using vs2k5. My project is using
Crypto++ lib project, which has a function (ComputeHash), and with the
same name of function I have written in project with a little bit
change as follows
Crypto++ function:
protected: unsigned int __thiscall
CryptoPP::Defla tor::ComputeHas h(unsigned char const *)const
My function:
unsigned char * __stdcall ComputeHash(cha r *)
For exporting function I am using "__declspec(dll export)", by using
declspec my exported functions will be name mangled (right??) and if I
do a function over loading of the same function, it also works fine.
If I want to export functions with out name mangling, using def file it
result in a link error. My understanding is that error comes because
over loading is not allowed using unmangled exported function, is that
right?
But, if I use
extern "C" unsigned char * __stdcall ComputeHash(cha r *)
Name mangling will be removed against this function extern "C" will
be the part of function signatures. If I have two functions, they
overload each other and wants to export these functions with out name
mangling the question is how to full fill this need? I seen that if one
function exported by def and other function exported by using extern
"C", both will be export successfully and will not be name mangled.
My first question, what is the difference of exporting function by
using extern "C" and def files?
Regards,
-aims 1 1355
My function:
unsigned char * __stdcall ComputeHash(cha r *)
For exporting function I am using "__declspec(dll export)", by using
declspec my exported functions will be name mangled (right??)
If you do nothing else, then yes. All names will be mangled.
If I want to export functions with out name mangling, using def file it
result in a link error. My understanding is that error comes because
over loading is not allowed using unmangled exported function, is that
right?
Indeed. you can export overloaded functions, but not without name mangling
because name mangling is used by the compiler to determne which function to
call.
But, if I use
extern "C" unsigned char * __stdcall ComputeHash(cha r *)
Name mangling will be removed against this function extern "C" will
be the part of function signatures.
Nope. extern "C" only behaves like that for functions that are __cdecl.
For __stdcall it won't work, and your function will still be mangled.
You can verify this with depends.exe
overload each other and wants to export these functions with out name
mangling the question is how to full fill this need?
Not.
As I explained above, name mangling is essential to overloading.
--
Kind regards,
Bruno van Dooren br************* *********@hotma il.com
Remove only "_nos_pam" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Sullvan |
last post by:
Sorry for being a little off-topic, but I guess PHP
users are often MySQL users too.
We have a few rather advanced calculation routines
developed in C++. Currently we are using a Sybase ASA
database for our app. and these routines are accessible
by so called external functions exported by a DLL
(dynamic link library) that we wrote in C++. Sybase
supports this quite nicely.
|
by: Peter Sullvan |
last post by:
We have a few rather advanced calculation routines
developed in C++. Currently we are using a Sybase ASA
database for our app. and these routines are accessible
by so called external functions exported by a DLL
(dynamic link library) that we wrote in C++. Sybase
supports this quite nicely.
The client app can call such routines by:
"select get_roof_angle() as angle from dummy;"
|
by: Ian |
last post by:
Peace, language lawyers!
I'm developing a (static) library for a "memory-challenged"
platform (ie, mobile).
I want to (force the compiler to) inline some functions -- that
are not meant to be exported to the library's clients.
Example:
|
by: Kevin Aubuchon |
last post by:
Hello,
I need to use a Win32 DLL for a C# client. Any advantage exposing my
functions as a COM object versus exported C functions? There will only be a
few function calls. Using COM seems like too much overhead for the little
interaction. I'm open to any insights or opinions.
Thanks in advance,
--
|
by: xbsantos |
last post by:
Functions exported in C++ and global variables;
Hello,
I'm working with a DLL project in VISUAL C++ that exports one function with
the sentence
__declspec(dllexport). The problem is that this function returns the value
of a dll global
variable, but in fact the application that imports this functions from the
dll only see the
| |
by: Richard |
last post by:
In VB.NET, I am successfully calling C++ functions and subroutines
that were exported from a DLL. Is it also possible in VB.NET to
directly access a variable that was exported?
Specifically, the DLL has C++ functions and variables that were
exported with __declspec(dllexport). In VB.NET, I can call the
functions after declaring with DllImport. However I haven't figured
out how to access exported variables (not functions or subroutines)....
|
by: Anonymous |
last post by:
Is it possible to have an ATL project that also contains win32 exported
classes and functions?.
I have a project (module) that needs to export/expose a few ATL objects,
however, other modules depend on the existing exported C++ classes. I
have been adviced that to export the ATL COM object, I should do the ff:
1). Create an ATL project
2). Move the existing code to it
|
by: =?Utf-8?B?SmVzc2ljYQ==?= |
last post by:
Hi All,
I know that I can use the GetProcAddress to get the proc address of a global
exported function from a WIn32 dll.
But if I have an exported class in the dll, is there a way to dynamically
load this dll and get an instance of this class? (No static linking with the
lib file) I am currently thinking about having global exported functions
which internally calls the member functions of the class's single instance.
These global...
|
by: evenlater |
last post by:
I have an Access application on a terminal server. Sometimes my users
need to export reports to pdf, rtf or xls files and save them to their
own client device hard drives.
They can do that right now the way I have this set up, but it's
confusing and slow. When they browse for a place to save the reports,
they see all of the drives on the terminal server as well as their own
client drives. So they're likely to want to choose "My...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |