You can simply create your stream in the OnInitDialog function. There is no reason for an excessive compromise by going over and looking for another function or dividing the initialization code in two. (There is also no such function, because there is no corresponding Windows message that is sent.)
If you want to get your dialog box on screen before creating the stream, you can simply show it manually using the ShowWindow function . For example:
ShowWindow(SW_SHOW); RedrawWindow();
Also see this post by Raymond Chen: Waiting for a dialog box to appear before doing something.
Cody gray
source share