IonicWind Software

IWBasic => GUI Central => Topic started by: dippy46 on December 16, 2006, 06:25:45 PM

Title: Window Handles
Post by: dippy46 on December 16, 2006, 06:25:45 PM
Hi all

I wasn't quite sure where to make the post, but after reading thru I saw the question about passing a handle to a DLL call. However the problem I have is the reverse. I need to pass a hWnd to ebasic from a calling application because the ebasic code will be the DLL. Then I want to attachscreen thereby outputting to the callers window. I thought about possibly passing buffer pointers but I think that, that sort of inter process activity would not be allowed. Desperately in need of help on this one. Maybe only Paul knows the answer, or maybe there's a workaround.

Regards

Dave.

ps: Poor example but the idea is where it's atÂÃ,  ;D


WINDOW w1
w1 = 918322 ' value provided by the caller


IF(ATTACHSCREEN(w1,50,50,TRUE) < 0)
ÂÃ,  ÂÃ,  MESSAGEBOX w1,"Couldn't create DirectX window","Error"
ÂÃ,  ÂÃ,  CLOSEWINDOW w1
ÂÃ,  ÂÃ,  END
ENDIF
Title: Re: Window Handles
Post by: Ionic Wind Support Team on December 16, 2006, 10:31:23 PM
If you are only going to use this DLL in Emergence then it is a simple matter of passing the WINDOW variable to the UDT to fill in. 

Otherwise you are better off creating the window in the DLL itself, and not use a handle passed from another language. 

Paul.
Title: Re: Window Handles
Post by: dippy46 on December 17, 2006, 01:53:39 AM
@Paul

Thanks for your quick reply. More or less what I expected. However since I first posted I had already started looking at the possibility of as you say creating the window in the dll, but then try to offer up the window to the calling process. However I don't yet see clearly a method for locking the window into the callers window much like a child. If I am able to figure it out I will certainly post the code.


Regards
Dave
ÂÃ, 
Title: Re: Window Handles
Post by: Ionic Wind Support Team on December 17, 2006, 02:02:03 AM
The actual OS handle to the window is a member of the WINDOW udt.

Mywindow.hwnd

Paul.