void CLogproView::OnFileOpen() 
{
// TODO: Add your command handler code here
DWORD dwVersion;
int   structSize; CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, 
_T("数据文件(*.txt;*.log;*.dat)|*.txt;*.log;*.dat|所有文件(*.*)|*.*|"), this);

//获取系统版本,以选择适当的打开对话框
dwVersion = GetVersion();
if (dwVersion < 0x80000000)
{
structSize = 88;
}
else
{
structSize = 76;
}

dlg.m_ofn.lStructSize = structSize;
dlg.m_ofn.lpstrTitle = _T("打开数据文件");
if (IDOK == dlg.DoModal())
{
g_strFileName = dlg.GetPathName();
}
else
{
return;
}

if (g_strFileName.IsEmpty())
{
return;
}

//ReleaseMem();
m_bFileOpen = FALSE;
DWORD dwThread;
m_hThread = ::CreateThread(NULL, 0, AnalyseFileThread, (LPVOID)this, 0, &dwThread);
if (m_hThread == NULL)
{
AfxMessageBox(_T("打开文件失败!"));
return;
}
}
打开按钮放在了菜单栏上 调试的时候 点击打开按钮 显示这个 
Warning: no message line prompt for ID 0x8004.

解决方案 »

  1.   

    我做了视图分割 这个对话框类是在其中一个视图类里定义的 
    是不是CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,  
    _T("数据文件(*.txt;*.log;*.dat)|*.txt;*.log;*.dat|所有文件(*.*)|*.*|"), this);中的this要换成别的指针?
      

  2.   

    试过了 没用 感觉是我试图分割有问题 BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(!m_wndSplitter.CreateStatic(this,2,1,WS_CHILD|WS_VISIBLE|WS_VSCROLL))
    {
       TRACE0("Failed to CreateStaticSplitter\n");
       return FALSE;
    }
    //Add Title View pane
    if(!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTitleView),CSize(500,100),pContext))
    {
      TRACE0("Failed to create title view pane.\n");
      return FALSE;
    }
    //Add curve pane
    if(!m_wndSplitter.CreateView(1,0,pContext->m_pNewViewClass,CSize(500,200),pContext))
    {
      TRACE0("Failed to create curve view pane.\n");
      return FALSE;
    }
    return TRUE;
    //return CFrameWnd::OnCreateClient(lpcs, pContext);
    }pContext->m_pNewViewClass 是不是这个不对啊 我要用到两个视图类 我定义了CScrollView类派生的 CTitleView 和CLogproView 类  这么分割画框架都可以画出来 就是打不开对话框啊 读不了数据
      

  3.   

    找到原因了 放在Title类里就可以打开了