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
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.
@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
ÂÃ,Â
The actual OS handle to the window is a member of the WINDOW udt.
Mywindow.hwnd
Paul.