Skip to main content
gamedev.net
🔒 Locked

UNICODE Errors

Started by Xore Aug 5, 2006 at 5:36 PM 1 replies 650+ views
Original Post
Xore
Xore
Ok, I'm making a project, and all of it has to be UNICODE, except for one header, and I get these errors:

c:\documents and settings\kyle\desktop\xds\SSCleaner.h(40) : error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\documents and settings\kyle\desktop\xds\SSCleaner.h(51) : error C2664: 'lstrcmpiW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I've tried doing #undef UNICODE and #undef _UNICODE. But I don't know how to fix it. That didnt solve the problem. Here are the lines of code:

(HMODULE hModule, char *szDllName, char *szFunctionName, DWORD pNewFunction)

(Line 40): if(!(pOldFunction = GetProcAddress((HMODULE)GetModuleHandle(szDllName), szFunctionName)))
(Line 51): if(!lstrcmpi(szModuleName, szDllName))

yadango
yadango
hmmm if i recall right it's perfectly safe to call the non-unicode versions of a function (ie. GetModuleHandleA instead of GetModuleHandle with UNICODE defined). so if one header has to be non-unicode, just call the non-unicode functions explicitly.
Xore
Xore
Thank you! I'm not getting the errors anymore =)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.