Not catching window close in DLL

Everything else that doesn't fall into one of the other PB categories.
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Not catching window close in DLL

Post by halo »

I am calling a DLL with Blitz3D. The widnow close event does not get caught. I even tried a Window callback, and the callback function never got used. (I had an End command at the beginning of the callback, to test with.)

Global WIN
Global GADGET_KEYS
Global WINDOWCLOSED
Global SVAR.s

ProcedureDLL.l CS_InitProperties(hwnd)
win=OpenWindow(0,0,0,400,300,#PB_Window_TitleBar+#PB_Window_ScreenCentered+#PB_WINDOW_INVISIBLE+#PB_Window_SystemMenu,"Properties")
CreateGadgetList(win)
GADGET_KEYS=StringGadget(#PB_ANY,0,0,400,300,"",#PB_String_Multiline)
CloseGadgetList()
ProcedureReturn win
EndProcedure

ProcedureDLL.l CS_Properties(keys$)
WINDOWCLOSED=0
SetGadgetText(GADGET_KEYS,keys$)
HideWindow(0,0)
Repeat
eventid=WaitWindowEvent()
Select eventid
Case #PB_Event_CloseWindow
WINDOWCLOSED=1
EndSelect
Delay(1)
Until WINDOWCLOSED=1
SVAR.s=GetGadgetText(GADGET_KEYS)
HideWindow(0,1)
ProcedureReturn @SVAR
EndProcedure
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Post by halo »

Now here is where it gets interesting.

I am using two near-identical DLL's for different dialogue windows. Both are about the same as the above code, and I even added a CloseGadgetList() to try to fix things.

The FIRST DLL that gets initialized, the InitProperties() or whatever command, works perfectly. The SECOND dll that gets the window initialized does not return events!
halo
Enthusiast
Enthusiast
Posts: 104
Joined: Mon Jan 26, 2004 2:49 am

Post by halo »

Then I tried using '0' for one window and '1' for the other, and it worked. 2 different DLL's.
Post Reply