Hi;)
I would like to share some of my observations resulting from my work on BoE open source code. I use Dev-C++ compiler and at this moment code is compiling and running, but it wasn't easy. During my work, I have found some strange errors, like unexpected program collapsions, or terminations. To find out, what's going wrong I have spent a lot of time on debugging. I hope this post will save some time to people who have found similar problems.
First obstacle was an unexpected program collapsion while showing dialog box window. The reason of this situation is incorretly string formatting in "dummy_dialog_proc" (DLOGTOOL.CPP file) dialog window procedure. As we can see in line 616:
Code:
[...]else sscanf(item_str,"%d_%d",&type,&flag);[...]
'type' and 'flag' variables has 'short' type, while formatting string ("%d_%d") describes 'long' types. Properly, formating string should be "%hd_%hd".
Next thing is program terminiation, while closing dialog box windows. That was very frustrating, because everything seems to be OK. In this situation something is littering our application message queue with WM_QUIT message. Problem lies in implementation of "fry_dc" function (GRAPHUTL.CPP file, line 612). The solution is to rewrite this function to something like this:
Code:
void fry_dc(HWND hwnd,HDC dc) { if(!ReleaseDC(hwnd, dc) && !DeleteDC(dc)) PostQuitMessage(0);}
Ok, that's all what I have to say (now;)). Hope that anybody find it useful.Bye;)