Mixing Notes C APIs with Notes C++ classes

I am supporting a DLL that uses Notes C APIs to process NSF files. However, one of the APIs, NSFNotesExtractFileExt() crashes on opening encrypted documents. The alternative solution to the C API is to use LNDocument::Detach to open the encrypted document. I tried to use the C++ class in the DLL where the C APIs are currently being used. When I attempted to load the DLL after the change, I get an error. If I remove the reference to the C++ class, then I am able to load the DLL. Is there an issue with mixing C APIs with C++ classes? If so, is there a way around this problem?

Any help will be appreciated.

Rony

Subject: Mixing Notes C APIs with Notes C++ classes

The C++ is built on top of the C API, so you can certainly use them, but the C++ API is built on an older version, so you may be causing a conflict between the two versions. Usually when you mix the two, you start with the C++ API and “drop down” to the C API. I don’t know how much code you have, but it might be worth taking that approach, and simply getting the Notes handle and such from the C++ API calls and passing them to the C API calls, as opposed to the opposite.

I wish I could help more, but it has been a while since I have had to do such things. I stick with the C API entirely now.

Of course, the other approach is to figure out why the NSFNotesExtractFileExt call would crash. I am pretty sure I have run both NSFNoteExtractFile and NSFNoteExtractWithCallback on encrypted documents, but I don’t see any places where I use NSFNotesExtractFileExt. Could you try one of the others?

Subject: RE: Mixing Notes C APIs with Notes C++ classes

he C++ is built on top of the C API, so you can certainly use> them, but the C++ API is built on an older version, so you

may be causing a conflict between the two versions.

There’s a document within c++ documentation “New and changed features in this release” which has details about built in c-api version used in c++ lib. It also tells you how to upgrade to a newer release.

There’s only one drawback on updating included c-api: Even if c++ library would be compatible with e.g. Notes Release 6, but updated c-api expects Notes 6.5 you can’t use your program on Release 6.

And i’m pretty sure call to NSFNoteExtractFileExt can be fixed. I’ve used it on encrypted docs as well and never run into any problems before…

Markus

markus.seitz@icodex.com

Subject: RE: Mixing Notes C APIs with Notes C++ classes

True, it is possible to update the built in version, but I wouldn’t bother until I was quite sure the older version wouldn’t work.