开发者

Visual Studio 2008 C++ Writing to a dialog during OnInit or at startup

Ok, If I cannot write on a dialog during oninit by:


You can't use the funct开发者_Python百科ion SSTextOut() in OnInitDialog(). OnInitDialog() is called before your dialog is displayed, so you can't get a valid CDC inside of it (because the dialog hasn't been drawn yet).

From the looks of it, SSTextOut() is meant to be called from an OnPaint() override.


Is there any way I can write some text to the 1st dialog screen at startup. I want to put some info on the dialog screen under program control rather then by static text!


I'm not sure what SSTextOut is, but during OnInitDialog, the dialog does have a valid DC. It hasn't been displayed yet, but it does exist, and so do all the controls in the dialog, so putting text into a control (e.g. an Edit control) is perfectly valid, and when the user sees the dialog, the text will be there as soon as the user sees the dialog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜