I have written a .dll library with lots of functions and classes in visual studio 2010. When I look at the content of the file with:
dumpbin.exe /EXPORTS myDll.dll
I get long function names with some kind of a function location pointer, which looks like this (second entry in .dll):
2 1 0001100A ?Initialize@codec@codecX@@SANNN@Z = @ILT+5(?Initialize@codec@codecX@@SANNN@Z)
This is somehow hard to read, but I saw "nicer" procedure/function list from other .dll-s, like this:
141 8C 00002A08 PogoDbWriteValueProbeInfo
How can I make that .dll list look that way?
P.S.: my dll source code looks like this:
namespace codecX
{
class codec
{
public:
static __declspec(dllexport) double Initialize(double a, double b);
...
You can list function names for a specific DLL, such as user32. dll, by running a variety of command-line tools. For example, you can use dumpbin /exports user32. dll or link /dump /exports user32.
The Microsoft COFF Binary File Dumper (DUMPBIN. EXE) displays information about Common Object File Format (COFF) binary files. You can use DUMPBIN to examine COFF object files, standard libraries of COFF objects, executable files, and dynamic-link libraries (DLLs).
A DLL helps promote developing modular programs. It helps you develop large programs that require multiple language versions or a program that requires modular architecture. An example of a modular program is an accounting program that has many modules that can be dynamically loaded at run time.
You need to pull those static member functions into the global address space and then wrap them with extern "C". This will suppress the C++ name mangling and instead give you C name mangling which is less ugly:
extern "C" __declspec(dllexport) Initialize(double a, double b)
{
codec::Initialize(a, b);
}
and then remove the __declspec(dllexport) on your static member functions:
class codec
{
public:
static double Initialize(double a, double b);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With