If you are having problems when your program ends, it's more than likely error 1: Programmer Error.


The DLL is loaded in your process space until LibMain gets DLL_PROCESS_DETACH. That is, however, a notification not an opportunity and once that message has been disposed of you cannot use any functions in that DLL.
The part of notification and not an opportunity I TOTALLY missed until I was writing this reply, but it hit me, the function is more ("Hey, you are now part of the program", or "Hey, you are now alone") type of thing than it is "Hey you are ABOUT to be" part or not part
Given your problem...
... your problem is simply, "Don't allow the window to close until the message box has been dismissed." Easiest way is to eschew the intrinsic MSGBOX statement and use the WinAPI MessageBox function, specifying hWndMain as the parent window... MessageBox will automaticaly disable hWndMain until MessageBox has returned.
... your problem is simply, "Don't allow the window to close until the message box has been dismissed." Easiest way is to eschew the intrinsic MSGBOX statement and use the WinAPI MessageBox function, specifying hWndMain as the parent window... MessageBox will automaticaly disable hWndMain until MessageBox has returned.

The other option I have to look at is
EnableWindow hWndMain, %FALSE
iret = MSGBOX (whatever)
Do stuff
EnableWindow hWndMain, %TRUE
iret = MSGBOX (whatever)
Do stuff
EnableWindow hWndMain, %TRUE
Now that I have typed so long in a reply and the one thing I was going to ask, MCM may have already stated, but I did not get the concept at first was "Notification...NOT opportunity"....AKA if I can catch the <"quote unquote"> parent closing, and call the cleanup function and all errors go away...but if I rely on the "Notification" of LibMain then my cleanup may never happen, and hence my crash.
(or at least tests seem to follow what I think I am being told happens)

Leave a comment: