Re: Linking with 3rd party DLL
"Hans-J. Ude" <news@wolptec.de> wrote in message
news:6o3lt0F1gbv0U1@mid.individual.net...
"David Ching" <dc@remove-this.dcsoft.com> schrieb im Newsbeitrag
news:1357921A-1E4D-4882-8447-B6D831FC0E22@microsoft.com...
How does the function appear in Depends? Perhaps there is name mangling
going on, or the function is Pascal (so there is no leading '_'), etc.
that you need to reflect in the header you made.
It appears like that:
Export Ordinal Hint Function Entry
Point
------ ----------- ----------- ---------------------------- -----------
[C ] 16 (0x0010) 4 (0x0004) CreateCodeShort3 0x000020B0
I've been trying araoud with the '-'prefix, without success. The dll also
has anti debug protection. When I single step the exe it crashes in the
LoadLibrary call.
Thanks David, I'm gonna contact their tech support.
Yes, I'm sure they'd be glad to help on such a basic question! It looks
though like you may just need to add WINAPI to your prototype function.
There is no '_' in the exported function above, and your other message about
the ESP not being preserved is classic for mismatched calling conventions.
Try adding WINAPI to the function prototype:
extern "C"
{
const char* WINAPI CreateCodeShort3(int level, const char *name, const
char
*encryption_template, unsigned long hardwareID, unsigned short
otherinfo1, unsigned short otherinfo2, unsigned short otherinfo3,
unsigned short otherinfo4, unsigned short otherinfo5);
}
-- David