第一次用VC开发office插件,很多类型都不知道怎么用?
麻烦大家帮我看下怎么错的。
如果有VC开发office插件的例子就更好了。我就剩10几分了。。其他分都去押宝了
OutputDebugString("1");
pApplication->QueryInterface(__uuidof(IDispatch), (LPVOID*)&m_pApplication);
OutputDebugString("2");
pAddInInst->QueryInterface(__uuidof(IDispatch), (LPVOID*)&m_pAddInInstance);
OutputDebugString("3");
CComPtr <Outlook::_Application> spApp;
OutputDebugString("4");
CComPtr <Outlook::_NameSpace> pNS;
OutputDebugString("5");
spApp->get_Session(&pNS);  //这句出错。编译是通过的。但是运行的时候直接弹出崩溃窗口。
OutputDebugString("6"); OutputDebugString("7");
Outlook::MAPIFolder **Floder = {0};
OutputDebugString("8");
OutputDebugString("9");
pNS->GetDefaultFolder(Outlook::OlDefaultFolders::olFolderInbox,Floder);
OutputDebugString("10");