To qing_li73(bluemoon):
感谢关注及帮助,这样的例子我也有,我比较疑惑的是:
void CPowerPntDlg::OnBtnStart()
{
// Start PowerPoint and get Application object...
if(!app.CreateDispatch("Powerpoint.Application"))
{
AfxMessageBox("Couldn't start PowerPoint.");
}
else // Make PowerPoint visible and display a message
{
app.SetVisible(TRUE);
TRACE("PowerPoint is Running!");
}
}
就是这句app.SetVisible(TRUE)。
上面的例子只是通过一个对话框去启动一个ppt的app,并作相应操作,而我所要达到的效果是让ppt的页面嵌入到我的对话框当中,并由我控制。我尝试将app.SetVisible(TRUE)改成app.SetVisible(FALSE),就会抛出异常,错误信息是
“Application.Visible:Invalid request. Hiding the application window is not allowed.”这真奇怪,若是不能将applicationwindow设置成不可见的话,为什么要提供这么个SetVisible呢?