我在dll中加入如下代码 SHDocVw::IShellWindowsPtr m_spSHWinds;
if (m_spSHWinds == NULL)
{
if (m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) != S_OK)
{
AfxMessageBox("Failed");
CoUninitialize();
// EndDialog(1);
}
}当走到
m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) != S_OK)
时候就死掉了不知道为什么?
if (m_spSHWinds == NULL)
{
if (m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) != S_OK)
{
AfxMessageBox("Failed");
CoUninitialize();
// EndDialog(1);
}
}当走到
m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) != S_OK)
时候就死掉了不知道为什么?
否则出问题很容易死。
{
_bstr_t bstrSource (e.Source());
_bstr_t bstrDescription (e.Description());
CString strError;
strError.Format("无法备份Sybase数据库。\r\n错误代码是:%08lx\r\n错误的原因是:%s\r\n错误源是:%s\r\n错误的描述是:%s\r\n", e.Error (), e.ErrorMessage (), (LPCTSTR) bstrSource, (LPCTSTR) bstrDescription);
MessageBox (strError, bstrDescription,MB_OK);
return false;
}
m_spSHWinds.CreateInstance(__uuidof(SHDocVw::ShellWindows)) != S_OK)
还是会死掉,catch根本抓不到!郁闷阿!
难道dll 中不可以用这样的com 吗?
CLSIDFromString
IIDFromString
这些