HWND

Are you developing an External using the LiveCode Externals SDK?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

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

HWND

Post by shaosean » Thu May 10, 2012 10:16 am

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: 127
Joined: Mon Mar 12, 2007 12:06 pm

Re: HWND

Post by n.allan » Mon May 14, 2012 10:21 am

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: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: HWND

Post by shaosean » Mon May 14, 2012 12:38 pm

I will give that a try.. and extra points for answering 3 of the 4 bonus questions ;-)

shaosean
Posts: 878
Joined: Thu Nov 04, 2010 7:53 am

Re: HWND

Post by shaosean » Tue May 15, 2012 7:39 am

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

Post Reply

Return to “Building Externals/Plugins”