visual c++ - VC++ Dll Not Working On Windows XP Sp3 When Using C++ Builder -
i have created vc++ dll in visual studio 2013.
extern "c" int __declspec(dllexport) __cdecl convertimagetotext(char* datapath, char* imagefilepath, char* captchacode) { // return 0; } i'm using in borland c++ builder 6 that.
hmodule dllhandle = loadlibrary("captcha.dll"); int (__cdecl *convertimagetotext)(char*,char*,char*); convertimagetotext =(int (__cdecl *)(char*,char*,char*))getprocaddress(dllhandle, "convertimagetotext"); if (convertimagetotext != null ) { convertimagetotext("","",""); }else { showmessage("convertimagetotext pointer not found !"); } it's working in win7/8/8.1.there isn't problem.
but can't find pointer of convertimagetotext on windows xp sp3.
i have changed vc++ dll project "platform toolset" "visual studio 2013 - windows xp (v120_xp)".nothing not changed.
i have checked visual c++ redistributable packages.all installed
any sugguestions ?
you need implement proper error checking described documentation.
- test return value of
loadlibrary. value ofnullindicates failure. if so, callgetlasterrorextended error details. e. test return value ofgetprocaddress. value ofnullindicates failure. if so, callgetlasterrorextended error details.
likely loadlibrary failing because dll linked runtime not installed on target machine, or because dll linked win32 api functions not exist on xp.
if cannot work out here can use dependency walker debugging. use in profile mode debug loader's attempt load dll. reveal enough information diagnose problem.
Comments
Post a Comment