本文介绍了Lotus Notes Automation:Notes.NotesSession不实现Domino :: ISession?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试改进我的Lotus Notes客户端代码:

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

工作:

#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 来实际调用方法。

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

我发现一些在网络上,看起来很多saner,并假定一个更高版本的Notes版本: p>

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"))))
    ...

但是,返回 E_NOINTERFACE 。因为别人声称有类似的代码工作,我想知道这里可能发生什么,谦恭地问,是否有其他人有工作代码实例化一个Session对象并获得一个工作接口指针。

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.

推荐答案

使用domobj.tlb,您应该使用Domino.NotesSession而不是Notes.NotesSession。

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

这篇关于Lotus Notes Automation:Notes.NotesSession不实现Domino :: ISession?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 22:47