Re: dllexport and DEF files!! by Bruno
Bruno
Wed Sep 20 10:36:37 CDT 2006
> OK I'm writing a dll in C (can't use C++), and I was using the
> _declspec(dllexport) to export the functions, however it crashed when
> making calls because I didn't have a DEF file.
Why? This is by no means a requirement.
> Now I understand you only need a DEF file if you don't use
> _declspec(dllexport) or if you're using _stdcall calling convention,
> which I'm not.
Technically speaking, the calling convention has no influence.
For exporting, you can use either the declspec or the DEF files.
What i usually do is this:
#ifdef __cplusplus
extern "C"{
#endif
_declspec(dllexport) int _cdecl fun1(...);
_declspec(dllexport) int _cdecl fun2(...);
#ifdef __cplusplus
}
#endif
--
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"