July 13, 2024, 08:30:51 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Window Handles

Started by dippy46, December 16, 2006, 06:25:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dippy46

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

dippy46

@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
ÂÃ, 

Ionic Wind Support Team

The actual OS handle to the window is a member of the WINDOW udt.

Mywindow.hwnd

Paul.
Ionic Wind Support Team