#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif CBtolPlayerDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with Cancel
} // Since the dialog has been closed, return FALSE so that we exit the
//  application, rather than start the application's message pump.
return FALSE;
代码如上。dlg.DoModal()没有弹出对话框,直接到了return FALSE了。
对话框中使用了一个AX日期控件。打开对话框时会提示 计算机中没有注册该控件,会不会是这个原因?

解决方案 »

  1.   

    应该是,你找到这个控件的DLL,
    使用regsvr32组册一下
      

  2.   

    日期控件?什么日期控件??
    是不是加了 RichEdit控件???如果加了这个控件 要加 AfxInitRichEdit() 函数
      

  3.   

    控件类名是CBCGCalendar。这个是VC自带的么?
    我在工程--》增加到工程--》components and controls -->Registered ActiveX Controls 找不到,不清楚是没有还是我不认识那个控件。
      

  4.   

    CBCGCalendar是BCG的控件 ,不是vc自带的
      

  5.   

    这个工程是别个写的。我要改能编译不能运行,逐步打断点发现domodal失败。都晕了