nw-gyp icon indicating copy to clipboard operation
nw-gyp copied to clipboard

Unicode problem

Open digital-flowers opened this issue 8 years ago • 3 comments

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

digital-flowers avatar Aug 24 '16 07:08 digital-flowers

I ran into the same problem. A simpler solution is to explicitly use GetModuleHandleA, i.e. the non-wchar/unicode version.

DuBistKomisch avatar Sep 26 '16 10:09 DuBistKomisch

@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 ;)

digital-flowers avatar Sep 26 '16 11:09 digital-flowers

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.

robert-j avatar Jun 09 '20 10:06 robert-j