Have the same "bug fixing" And i also need to simulate AfxMessageBox

"Tell us what the problem is"
Okay

In OnCreate of MainFrame I have a function call that connected with two other custom classes (children of view and dialog), one of them connected with hardware.
I have calling this function in 2 other places.
And two types of starting program: with hardware connected/hardware disconnected

In first type of start everything is fine
In second type of start function works properly everythere except OnCreate.