佚名通过本文主要向大家介绍了automation错误,automation是什么意思,office automation,rockwell automation,automation studio等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 在automation中弹出对话框,office插件遇到的问题
描述:
描述:
在给office做插件时如何弹出自己的对话框。不是在office工具栏中增加按钮。
像这样:
STDMETHODIMP CMyAddin::OnConnection(IDispatch* Application, ext_ConnectMode ConnectMode, IDispatch* AddInInst, LPSAFEARRAY* custom)
{
if (NULL == Application) return E_POINTER;
CDlg dlg; //CDlg对话框资源在我的dll中。
dlg.DoModal();
return S_OK;
}
这样做总是会引起一个ASSERT错误。
我分别在Regular DLL using shared MFC DLL,MFC Extension DLL(using shared MFC DLL),还有ATL中试过,都会引起同样的错误。
请各位高手指教,给出正确的方法。