HELP Creating a DLL whose exported functions are not name mangled

HELP Creating a DLL whose exported functions are not name mangled

Post by John Clinga » Thu, 05 Sep 1996 04:00:00



I am new to windows development and am trying to create a DLL whose
exported functions are not name mangled. For instance:

#define DllImport       __declspec( dllimport )
#define DllExport       __declspec( dllexport )

DllExport int WINAPI funca(char *x);


the exported function is simply funca? I have seen 32-bit DLLS which do
not do this, so I know it is possible.

The reason I am doing this is so I can call this function from

size.
I am using VC++ to create the DLL.

Any help would be greatly appreciated. Thanks.

 
 
 

HELP Creating a DLL whose exported functions are not name mangled

Post by stephen girot » Fri, 06 Sep 1996 04:00:00


use the 'extern C' modifier around the function decl'n.


>I am new to windows development and am trying to create a DLL whose
>exported functions are not name mangled. For instance:
>#define DllImport   __declspec( dllimport )
>#define DllExport   __declspec( dllexport )
>DllExport int WINAPI funca(char *x);

>the exported function is simply funca? I have seen 32-bit DLLS which do
>not do this, so I know it is possible.
>The reason I am doing this is so I can call this function from

>size.
>I am using VC++ to create the DLL.
>Any help would be greatly appreciated. Thanks.


 
 
 

HELP Creating a DLL whose exported functions are not name mangled

Post by John Clinga » Fri, 06 Sep 1996 04:00:00


The problem is not C++ name mangling, but __cdecl vs. __stdcall. I am
trying to call 32-bit dll functions from Powerbuilder and don't want to

how PB cleans the stack, but I have seen PB work with 32-bit dll's in
the latter case.


> use the 'extern C' modifier around the function decl'n.


> >I am new to windows development and am trying to create a DLL whose
> >exported functions are not name mangled. For instance:

> >#define DllImport      __declspec( dllimport )
> >#define DllExport      __declspec( dllexport )

> >DllExport int WINAPI funca(char *x);


> >the exported function is simply funca? I have seen 32-bit DLLS which do
> >not do this, so I know it is possible.

> >The reason I am doing this is so I can call this function from

> >size.
> >I am using VC++ to create the DLL.

> >Any help would be greatly appreciated. Thanks.

 
 
 

HELP Creating a DLL whose exported functions are not name mangled

Post by Chris Marriot » Sat, 07 Sep 1996 04:00:00



>I am new to windows development and am trying to create a DLL whose
>exported functions are not name mangled. For instance:

>#define DllImport      __declspec( dllimport )
>#define DllExport      __declspec( dllexport )

>DllExport int WINAPI funca(char *x);


>the exported function is simply funca? I have seen 32-bit DLLS which do
>not do this, so I know it is possible.

Simply add:

        EXPORTS
                funca

to your DLL's DEF file.

Chris

--------------------------------------------------------------------------
 Chris Marriott, Warrington, UK      | Author of SkyMap v3 award-winning

            For full info, see http://www.execpc.com/~skymap  
      Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------