Lotus Notes Automation: Notes.NotesSession doesn't implement Domino::ISession?

匿名 (未验证) 提交于 2019-12-03 01:34:02

问题:

I'm trying to improve my Lotus Notes client code:

Working:

#import "...\IBM\Lotus\Notes\notes32.tlb" no_dual_interfaces raw_native_types  CComPtr<IDispatch> session_dispatch; if(FAILED(session_dispatch.CoCreateInstance(_T("Notes.NotesSession"))))     ... NOTESSESSION *session = static_cast<NOTESSESSION *>(*&session_dispatch); 

This gives me a valid NOTESSESSION object that is aware that it needs to go through IDispatch to actually invoke methods.

I found some example code on the net, which looks a lot saner and assumes a later Notes version:

#import "...\IBM\Lotus\Notes\domobj.tlb" raw_interfaces_only raw_native_types  CComPtr<Domino::ISession> notes; if(FAILED(notes.CoCreateInstance(_T("Notes.NotesSession"))))     ... 

However that returns E_NOINTERFACE. As others claim to have similar code working, I wonder what may be going on here, and humbly ask whether anyone else has working code to instantiate a Session object and get a working interface pointer.

回答1:

With domobj.tlb, you should use "Domino.NotesSession" rather than "Notes.NotesSession".



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!