Email:   
Home
In This Issue
Email a Friend
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Using Python to create a command line interpreter for Notes (continued)

There are two main ways in which a scripting language like LotusScript or Python can control remote programs via COM. The explanation here should also clear up some confusion caused by the recent announcement of COM support for Notes.

The simplest method is known as "late-bound COM" and requires the scripting environment to know practically nothing about the remote program. It simply creates an object and every time a method or property is called, it makes long-winded checks that the remote object does, in fact, support that method and that the parameters are passed correctly for it.

This method is easiest for developers of scripting languages to implement and easiest for you to use in your script, but since there's so much checking of procedures and parameters on every call, it's very inefficient and hence slow. Some languages, such as VBScript, are limited to late-bound COM, and this is also what Lotus Notes clients and Domino servers have supported since the very early days. In fact, the Lotus and Microsoft teams practically developed this sort of functionality between them, in the days when it was known as OLE and COM servers were known as "OLE Automation Servers."

The alternative is "early-bound COM," which requires the COM Server to list all of its public classes, methods, and constants in a standard file (suffixed with a TLB file extension). This allows remote programs (whether they be LotusScript calling Excel, or Python controlling Notes), to understand the structure of the remote classes; cut down drastically on the amount of run-time checking; and allow programmers access to the same constants (such as color codes or outline entry types), as are available in the remote program's own development environment. When programming in LotusScript, you can see the results of this for other COM Servers in the "OLE Classes" browser, as shown in Figure B.

FIGURE B

Here you see the COM browser in the LotusScript IDE. Click picture for a larger image.

When Lotus recently announced that, with R5.0.2b, Notes would support COM, what they really meant was that Notes would support early-bound COM calls by other languages. It has always supported the earlier type of COM interface. Also, to cut out another area of possible confusion, early-bound and late-bound COM are two variants of IDispatch COM objects. COM also includes objects more suited to C++ than scripting languages, which are used in a completely different way from the COM objects described here.

In Visual Basic, the pre R5.0.2b late-bound COM call might look like this:

Dim workspace as Variant

Set workspace = CreateObject("Notes.NotesUIWorkspace")

Meanwhile, in early-bound COM, Visual Basic knows all about Notes classes and will let you declare classes directly. Note that from R5.0.2b onwards, both early-bound COM and late-bound COM classes have the "Lotus." prefix.

Dim session As NotesSession
Set session = CreateObject("Lotus.NotesSession")




[ Prev | Next ]

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
-- Advertisement --

AUTOMATE LOTUS NOTES USER ID MANAGEMENT
ID Manager 4.5 from HELP Software provides a new level of automaton for managing Lotus Notes IDs. ID Manager lets Lotus Notes administrators get out of the business of creating and managing user IDs. Use our ROI calculator to see how quickly ID Manager will pay for itself.

Learn more about HELP Software products
-- Advertisement --

INSTALL, UPGRADE NOTES CLIENTS WITHOUT VISITING EACH DESKTOP
Use InstallPump to automate your Notes R8 migration. InstallPump enables you to rollout Notes throughout the enterprise without visiting each desktop.

  • 100% fully automated Notes upgrades/installs.
  • Modify the Replicator Page, Address Book, and Desktop... and much more.

See for yourself. Full evaluation copy available at installpump.com.

Download your FREE evaluation copy of InstallPump today.

Copyright © 1998-2009, ZATZ Publishing. All rights reserved worldwide.
Editor's Login