Initializing Notes.NotesSession with C++ returns NULL

I have a problem when I try to initialize Notes.NotesSession pointer. It is returning NULL and pointer isn’t initialized.

First I’m importing notes32.tlb like this:

#import “C:\Program Files\IBM\Lotus\Notes\notes32.tlb” rename_namespace(“Lotus”) named_guids, rename(“TEXT”, “LOTUSTEXT”)

And then in the main function I’m initializing a notes pointer:

OleInitialize(NULL);

NOTESSESSIONPtr notes(“Notes.NotesSession”);

Lotus Notes opens but notes pointer stays NULL

What could be the problem?

Subject: Initializing Notes.NotesSession with C++ returns NULL.

Can anyone help?

I’ve tried the same thing in Visual Basic and it is working.

I can’t figure it out why it is not working in C++. Am I forgetting some initialization?