Part of the problem is probably the "name mangling" that C++ does to
create names that reflect overloading and class membership. One way
around this is to include the declarations under a
extern "C" {
__declspec(dllexport) int myfunction(...);
Quote:
}
then when you declare
__declspec(dllexport) int myfunction(...)
it will be declared with the name myfunction, not something like
weird link names are absolutely mandatory for handling C++
overloading, so you can't apply this to functions that have
overloads.)
If you plan to use the header file in pure C code, you need to write
#ifdef _cplusplus
extern "C" {
#endif
__declsepc(dllexport) int myfunction(...);
#ifdef _cplusplus
Quote:
}
#endif
so the header file will be syntactically correct in C and C++ and give
unmangled names in C++.
joe
Quote:
>Hi,
>I've made an dll using c++. There's a function calcdays which shall be
>exported.
>I'm using this dll under Basic prg.
>But it seems it doesn#t find the dll entry point. I've tried
>__decspecl(dllexprto)
>as well as AFX_EXT_CLASS with the whole class.
>InBasic I used
>declare function lib "day.dll" calcdays(arguments) as integer.
>Any idea?
Joseph M. Newcomer
http://www3.pgh.net/~newcomer