HWND

Are you developing an External using the LiveCode Externals SDK?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

HWND

Post 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?
n.allan
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 153
Joined: Mon Mar 12, 2007 12:06 pm

Re: HWND

Post 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!
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: HWND

Post by shaosean »

I will give that a try.. and extra points for answering 3 of the 4 bonus questions ;-)
shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: HWND

Post by shaosean »

Looks like all the above do work, just the debugger from MS is a piece of garbage compared to Xcode..
Post Reply