最近刚开始接触vs2005,当用MFC开发程序时发现好多控件不能用,我想用的textbox也是灰色的,在插入ativex窗口里发现了,放在对话框试了一下,可是却在CreateDlgControls这个函数里抱错,于是换上了个richedit control..用getdlgitem函数取得CWnd指针时 确是空的,而如果取按扭的指针的话却能取到这是怎么回事呢,我要用来在一个控件里显示一些东西 哪位有经验的能给指点下呢?就这点分了

解决方案 »

  1.   

    If you are using a rich edit control in a dialog box (regardless whether your application is SDI, MDI, or dialog-based), you must call AfxInitRichEdit once before the dialog box is displayed. A typical place to call this function is in your program's InitInstance member function. You do not need to call it for each time you display the dialog box, only the first time. You do not have to call AfxInitRichEdit if you are working with CRichEditView
    至于你说的textbox是灰的,看是不是属性设置的问题。
      

  2.   

    richedit control
    要在 CXXApp::InitInstance 中添加AfxInitRichEdit 方法