nw-gyp
nw-gyp copied to clipboard
Unicode problem
when compile any node addon with USE_WCHAR and UNICODE flags it works will in node-gyp module but it fails in nw-gyp and this a quick workaround to fix this problem
I ran into the same problem. A simpler solution is to explicitly use GetModuleHandleA
, i.e. the non-wchar/unicode version.
@DuBistKomisch i have no experience that much in cpp but this is how i solved it but now it is the turn of experts like you ;)
Windows has macros for this situation:
node_dll = GetModuleHandle(TEXT("node.dll"));
You just have to use the TEXT macro to wrap string literals. The macro expands to L"node.dll" for UNICODE and "node.dll" for single byte builds.
GetModuleHandle is already a macro that expands to the A or W version.