Win32 Bugs  ..



I list here the known bugs in Win32, which may cause you  endless search, as the cause will neither be in your source, nor be the fault of RosAsm (Do not forget to report these last case bugs: I cannot fix bugs I never encountered nor heard about):



LoadIconA will fail if your resources size grows over 0FFFF. Do not store huge data in Resources.



Dialog problems (not really a Win32 bug, but rather a different behaviour that is difficult to point out on the two main OS families 95/98/ME vs NT/2000/XP).


There are two kinds of Dialogs the ''Modeless'' ones, that are created by CreateDialogParam / CreateDialogindirectParam and the ''Modal'' ones, that are created by DialogBoxParam / DialogBoxindirectParam


The ''Modeless'' ones Returns immediately after running the Dialog (they give hand to the next coming code).


The ''Modal'' ones return only after closing the Dialog.


There is a serious problem with the different ways for closing these Dialogs. The WIn32 Documentation (the one I have) says that, for closing Modeless Dialog you should:


call 'USER32.DestroyWindow' D$DialogHandle


And that you should close Modal Dialogs with:


call 'USER32.EndDialog' D$DialogHandle, 0


This is not exactly the way it works. The fact is that, you will have to close Modal Dialogs from inside the Dialog Procedures, as long as they keep the execution flow for themselves. As opposed, for Modeless Dialogs, you will most often have to close them from outside the Dialog Proc, as long as other Code is running, at that time.


The problem is that applying the rule, as given in the documentation, will not work, under 95, if you have to close a Modal Dialog from inside its own Procedure, which is perfectly possible, if, from the outside, you send it a Message for  telling it to close. In such a case, under the 95 family, you have to close the Modeless Dialog the same way you close Modal ones (with 'EndDialog' instead of 'DestroyWindow'). This way works perfect on both OSes Families.


Trying to reformulate all of this in more clear way, we can say that:


You close all Dialogs by 'EndDialog', unless it is to be closed from ''outside'' the Dialog Procedure. Notice that, here, 'outside' / 'inside' is to be considered in the process logical. I mean, if, from inside the Dialog Procedure of a Modeless Dialog, you call for a Routine that includes a closure Statement, this one is also to be considered ''inside'' the Dialog Procedure.


~~~~~~~