I wrote a GUI for my application as a c++ addon. Now I want node to start 
without the console. To do this I changed the subsystem from console to 
windows and replaced the following in node_main.cc (latest stable):

int wmain(int argc, wchar_t *wargv[]) {

with

int wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, 
int nCmdShow) {
  int argc = __argc;
  wchar_t **wargv = __wargv;


It works, Node starts without console and you can run your script. Only you 
can't use console output unless you pipe it to some file or something else.
However after doing this my addon broke. Node will still load my addon and 
I can spawn a windows form and do stuff. However if I use uv or v8 stuff 
it'll crash because of an access violation at `mod->register_func(target);` 
in node.cc. Even a single `HandleScope scope` in the init function is 
enough to cause a crash.
The same addon works when I run it with node with console. Both node 
executables are built from the same source, just with/without the patch 
above.

I wonder how the access violation is related to changing node to a windows 
application? Any windows developer here who has a clue? Built-in stuff like 
a HTTP Server works without a crash. Loading modules works too, they just 
mustn't contain any v8/uv stuff. I can't figure this out...

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to