Some notes on the native DLL wx-c.dll

The wx.NET system is composed of a .NET DLL wx.NET.dll and a native DLL wx-c.dll.

The latter provides C-functions providing a C interface to the wxWidgets C++ libraries. The original wx-c.dll provided the initial code for some other wrappers of the wxWidgets libraries. the following information is relevant for those using the wx-c.dll directly.

From release 0.9 on, the native DLL when built for MS Windows defines its function in STDCALL convention. In this calling convention, the caller of the method is responsible for the deallocation of the method arguments on the stack. This is especially useful when dealing with C++ because deallocation here usually means that destructors have to run. Since this is standard convention when using .NET on MS Windows machines, also the wx-c.dll now provides its functions in STDCALL convention ... with exceptions.

Those that require CDECL calling convention can modify the source at a single line in file "wxnet_globals.h" since all functions shall be declared using the WXNET_EXPORT() macro (refer to Notes For Contributors).

Also users of the MinGW compiler and linker will obtain libraries exporting their functions in CDECL convention. MinGW supports STDCALL but does not implement the MS convention for symbols exporting code in STDCALL convention. The MS compiler prepends an underscore to these symbols. Thus, tools like depends.exe will show a symbol like "_wxApp_ctor@0" for a function named wxApp_ctor. This underscore is expected by the MS .NET PInvoke implementation. Unfortunately, this underscore is missing when compiling with the GCC of the MinGW edition. Thus, these compiler will compile wx-c.dll in CDECL edition.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads