This is a quick guide, not a tutorial on where to get started with programming in GroupWise. There are plenty of GroupWise examples on the internet but I *could not find* just a quick Visual Studio setup guide to be able to work with GroupWise. First Off..
References are the first thing that have to be done as in most applications. I was searching online for an API to download for far too long (You may have already come across this outdated Novell link). Quite simply, all that needs to be done is to install the GroupWise client, then add a COM reference to the correct library:
Using Microsoft Visual Express
- View (Toolbar) > Other Windows -> Solution Explorer
- Right click References > Add Reference
- Under COM tab find “GroupWare type library” and hit OK
This reference (and others such as the administration libraries) will appear when GroupWise is installed. This was tested with GroupWise 7 and 8.
Very, very handy link is Novell Groupwise SDK: Object API which I found somewhat hard to find despite its usefulness. More so because of the next topic:
Unfortunately I have been unable to find a way to get better binding with these libraries. As a quick example, lets look at the Login method that Novell’s documentation posts:
Account Login([String UserID], [String CommandLine], [String Password], [LoginConstants WhenToPrompt], [VARIANT Reserved])
With ‘Late Binding’ we should be able to have the CLI tell us that if I put an integer or decimal in the UserID that it would fail to compile. In Visual Studio it fails to load the types and thus when you hit Account.Login you will be greeted with objects to be passed to the method, and not strings and enumerations which ensure some degree of validity. If anyone has an answer to this I’d love to post it.
See more about Novell’s Groupwise API documentation on Late Binding (with VB)
Why not toss in a quick code example in case someone wants to branch off from it and play with the API.
GroupwareTypeLibrary.Application a = new GroupwareTypeLibrary.Application(); GroupwareTypeLibrary.Account acct = a.Login("username", null, "password", GroupwareTypeLibrary.LoginConstants.egwNeverPrompt, null); Messages messages = acct.MailBox.Messages; label1.Text = Convert.ToString(messages.Count);
This is as far as I went with GroupWise as it was more of a curiosity for me to write a really quick piece of code and browse over the functions to see if I could make anything useful and quick for a client.