我设计的是在一个对话框的上面有两个CPropertyPage,在点击其中一个CPropertyPage的控件按钮后调用一个exe的程序,程序调用运行完后,自动新增一个CPropertyPage页,然后把生成的结果在新添加的CPropertyPage上显示,可是我就不知道怎么自动新增啊,那位高手可以指点下下啊?

解决方案 »

  1.   

    CreateProcess加载exe程序,WaitForSingleObject等待进程句柄,AddPage添加新页。
      

  2.   

    我也是这么做的
    void CSvmParam::OnButTrain() 
    {
    SHELLEXECUTEINFO   ShExecInfo   =   {0};  
    ShExecInfo.cbSize   =   sizeof(SHELLEXECUTEINFO);  
    ShExecInfo.fMask   =   SEE_MASK_NOCLOSEPROCESS;  
    ShExecInfo.hwnd   =   NULL;  
    ShExecInfo.lpVerb   =   _T("open");  
    ShExecInfo.lpFile   =   _T("svm-train.exe");                          
    ShExecInfo.lpParameters   =   _T(svmstr);
    ShExecInfo.lpDirectory   =   NULL;  
    ShExecInfo.nShow   =   SW_SHOW;  
    ShExecInfo.hInstApp   =   NULL;              
    ShellExecuteEx(&ShExecInfo); 

    if(ShExecInfo.hProcess)
    {

    ::WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
    ::CloseHandle(ShExecInfo.hProcess);
    }
    CSvmSheet svmsheet;
    m_modelresult.Construct(IDD_PROP_MODELRESULT);
    svmsheet.m_sheet.AddPage(&m_modelresult);
    }
    可是不行啊,可以调用到exe,可是调用运行结束后没有新CPropertyPage生成啊
      

  3.   

    CSvmSheet svmsheet; 
    m_modelresult.Construct(IDD_PROP_MODELRESULT); 
    svmsheet.m_sheet.AddPage(&m_modelresult); 
    这些代码是干什么?不是在原来属性页上添加吗?怎么新建了一个?
      

  4.   

    我原来属性页上有两个CPropertyPage了,可是我想在运行完一个exe程序后在加多一个,但就是不懂怎么加,以为是用AddPage了