Introduction
This is an interface/class wrapper to assist .NET applications in accessing Lotus Notes as Typed data without requiring Late-Binding options to be turned on.
Background
Lotus Notes provides COM interfaces, but as anyone trying to use them may know, the interfaces are designed to return untyped objects and require late-binding. From a VB.NET standpoint, this requires altering the Strict options to allow for late-binding, causing the application to no longer enforce strong data typing.
This wrapper was developed to overcome this limitation, and actually, the UnmanagedWrapper
class could be used for any COM access that is implemented in the same manor that Lotus Notes has been implemented.
Using the code
The code is actually very easy to implement. You will need to have the Lotus Notes client installed. Then, add the LotusCW.vb file to your VB.NET application. There is no need to add a reference to the Lotus type libraries since this wrapper has all the information present. Since Lotus does return everything as an Object
, the constructor for each class takes an Object
, and then makes managed calls against that Object
. Here is an example that can be found in the LotusSample
class:
Dim MySession As New Lotus_cw.NotesSession(CreateObject("Notes.NotesSession"))
Debug.Print("UserName: " & MySession.UserName)
Points of interest
Beyond Lotus Notes, the UnmanagedWrapper
class should provide a means for other COM implementations. I would also like to acknowledge the CodeSmith tool that was used for class refactoring from an IDL file into this wrapper class.
Please note that only preliminary testing has been completed and my usage of Lotus Notes is limited to extracting email messages.