Oxygen Basic
Programming => Example Code => Topic started by: Peter on November 05, 2010, 08:40:03 AM
-
Deleted
-
I have OB alpha18 and I'm able to compile but the program crashes. :'(
(WinXP-SP3)
-
Hi efgee,
The message loop may need attention. You had problems with another O2 program and found that fixing the WinMain message loop resolved the problem on your system.
If an error is returned by GetMessage then this loop will not attempt to pass the Message back into Windows for further processing.
Charles
sys bRet
'
do while bRet := GetMessage (&wm, 0, 0, 0)
if bRet = -1 then
'show an error message
else
TranslateMessage &wm
DispatchMessage &wm
end if
wend
-
Yes okay Peter, I've put in exit while and exit for, into the next release (Alpha019).
On the subject of message loops, here it is from the horses mouth :)
http://msdn.microsoft.com/en-us/library/ms644928(VS.85).aspx
while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0)
{
if (bRet == -1)
{
// handle the error and possibly exit
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Charles