Page 1 of 1

HWND

Posted: Thu May 10, 2012 10:16 am
by shaosean
I really have no idea what I am doing wrong, but I cannot seem to get Rev's windowID converted over to a HWND in an external.. I grabbed some really old code of mine that seems to have worked previously, but no longer works.. And using the same method I use writing Mac externals seems to fail as well..

my old way

Code: Select all

HWND tWindowRef = (HWND)atol(p_arguments[0]);
from the mac

Code: Select all

HWND tWindowRef = (HWND)strol(p_arguments[0], NULL, 0);
I include windows.h, stdlib.h and stdio.h ... Am I missing an include? Am I messing something up with one of the conversions? Do I need more sleep? Should I just forget about Windows?

Re: HWND

Posted: Mon May 14, 2012 10:21 am
by n.allan
If I remember correctly, I used the atoi() function and then casted it to HWND type using something akin to the following:

HWND hwnd = (HWND)atoi(p_arguments[0]);

atol() would probably work too but I don't think it needs to be a long integer.

EDIT: YES your includes are fine, YES you need more sleep and NO do not give up on windows!

Re: HWND

Posted: Mon May 14, 2012 12:38 pm
by shaosean
I will give that a try.. and extra points for answering 3 of the 4 bonus questions ;-)

Re: HWND

Posted: Tue May 15, 2012 7:39 am
by shaosean
Looks like all the above do work, just the debugger from MS is a piece of garbage compared to Xcode..