当前位置: 代码迷 >> VBA >> 请教下面的代码哪个地方不对
  详细解决方案

请教下面的代码哪个地方不对

热度:1404   发布时间:2013-02-26 00:00:00.0
请问下面的代码哪个地方不对?
第一次用VC开发office插件,很多类型都不知道怎么用?
麻烦大家帮我看下怎么错的。
如果有VC开发office插件的例子就更好了。

我就剩10几分了。。。。。其他分都去押宝了。。。

C/C++ code
    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);  [color=#FF0000]//这句出错。编译是通过的。但是运行的时候直接弹出崩溃窗口。[/color]    OutputDebugString("6");    OutputDebugString("7");    Outlook::MAPIFolder **Floder = {0};    OutputDebugString("8");    OutputDebugString("9");    pNS->GetDefaultFolder(Outlook::OlDefaultFolders::olFolderInbox,Floder);    OutputDebugString("10");


------解决方案--------------------------------------------------------
你的outlook运行着没有?
  相关解决方案