when compiling below code, gives me warning, namely deprecated conversion string constant 'char*'.
in ways possible remove message (without explicitly suppressing warning)?
tried casting (const char*), no avail.
#include <windows.h> int main() { typedef int * (*mydownloadtourl)(void*, char*, char*, dword, void*); hinstance libhnd = loadlibrary("urlmon.dll"); mydownloadtourl mydownloadfunction = (mydownloadtourl)getprocaddress(libhnd,"urldownloadtofilea"); mydownloadfunction(0, "http://mywebsite.com", "webpage.htm", 0, null); }
you need const_cast<char*>("my string literal") rid of warning. in c++03 implicit conversion string literal (which const char*) char* deprecated. in c++11 such implicit conversion error.
in case though, urldownloadtofile takes arguments of type lpctstr, defined either const wchar_t* or const char* depending on unicode prepossessor directive.
Comments
Post a Comment