Click here to Skip to main content
12,395,327 members (69,088 online)
Click here to Skip to main content
Add your own
alternative version

Stats

38.6K views
944 downloads
15 bookmarked
Posted

Lotus Notes COM Class Wrapper for .NET

, 30 Aug 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
This is just a VB.NET class wrapper for the Lotus Notes interfaces.

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:

'' Create a new Lotus Notes Session
Dim MySession As New Lotus_cw.NotesSession(CreateObject("Notes.NotesSession"))

'' Output the Sessions UserName.
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

LeeBear
Software Developer (Senior) PRGX
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

 
QuestionIt is possible to use this code to obtain the number of unread mails? Pin
Member 922567913-Apr-13 4:00
memberMember 922567913-Apr-13 4:00 
AnswerRe: It is possible to use this code to obtain the number of unread mails? Pin
LeeBear15-Apr-13 2:23
memberLeeBear15-Apr-13 2:23 
QuestionImplementing for NotesUIWorkspace Pin
LesZ21-Dec-10 9:52
memberLesZ21-Dec-10 9:52 
AnswerRe: Implementing for NotesUIWorkspace Pin
LeeBear3-Jan-11 5:38
memberLeeBear3-Jan-11 5:38 
Questionhow would you use this to read a series of calendar events? Pin
Paul E.22-Sep-10 11:21
memberPaul E.22-Sep-10 11:21 
AnswerRe: how would you use this to read a series of calendar events? Pin
LeeBear23-Sep-10 3:01
memberLeeBear23-Sep-10 3:01 
QuestionFailed using nDB.AllDocuments.GetNextDocument method Pin
Edgardo Anibal14-Jul-09 9:33
memberEdgardo Anibal14-Jul-09 9:33 
AnswerRe: Failed using nDB.AllDocuments.GetNextDocument method Pin
LeeBear21-Jul-09 3:18
memberLeeBear21-Jul-09 3:18 
QuestionSetting RtnType in InvokeMethod Pin
dking12038-Oct-07 13:34
memberdking12038-Oct-07 13:34 
QuestionRe: Setting RtnType in InvokeMethod Pin
Edgardo Anibal14-Jul-09 10:27
memberEdgardo Anibal14-Jul-09 10:27 
AnswerRe: Setting RtnType in InvokeMethod Pin
LeeBear21-Jul-09 3:29
memberLeeBear21-Jul-09 3:29 
GeneralJust an Idle Question Pin
JohnDeHope330-Aug-07 14:12
memberJohnDeHope330-Aug-07 14:12 
GeneralRe: Just an Idle Question Pin
LeeBear21-Jul-09 3:31
memberLeeBear21-Jul-09 3:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 30 Aug 2007
Article Copyright 2007 by LeeBear
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid