Lotus Notes 自动化:Notes.NotesSession 未实现 Domino::ISession?
我正在尝试改进我的 Lotus Notes 客户端代码:
工作:
#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);
这为我提供了一个有效的 NOTESSESSION
对象,该对象知道它需要通过 IDispatch
来实际调用方法。
我在网上找到了一些示例代码,看起来更理智,假定为更高版本的 Notes:
#import "...\IBM\Lotus\Notes\domobj.tlb" raw_interfaces_only raw_native_types
CComPtr<Domino::ISession> notes;
if(FAILED(notes.CoCreateInstance(_T("Notes.NotesSession"))))
...
但是会返回 E_NOINTERFACE
。正如其他人声称有类似的代码工作一样,我想知道这里可能发生了什么,并谦虚地询问其他人是否有工作代码来实例化 Session 对象并获取工作接口指针。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 domobj.tlb,您应该使用“Domino.NotesSession”而不是“Notes.NotesSession”。
With domobj.tlb, you should use "Domino.NotesSession" rather than "Notes.NotesSession".