Working with COM

Last Updated: 9/12/2008

Sections above here:
Home  ยป  Development

Sections below here:

Topics in this section:
Rethinking the User Interface
Writing your first Delphi App
Images and Graphics
Extending Intraweb
Working with COM
Working with ClientDataSets
Creating PDA Applications
Error Handling
Control Size
Reading and writing custom cookies
Advanced Development
Session Locking

Search Documentation:

Initialization of COM

IntraWeb can automatically make the necessary calls to initialize COM. This is very much useful when working with components such as ADO to access data. To use this feature, set the property ComInitialization in the ServerController. It can take one of three possible values:

  • ciNone: No COM intialization is called. This is the default.
  • ciNormal: COM is initialized. This is the method used when deploying Standalone applications built with IntraWeb. It specifies the concurrency model as single-thread apartment.Internally, IntraWeb will make a call to CoInitialize(nil).
  • ciMultiThreaded: Use this setting when requiring COM initialization and when deploying as an ISAPI DLL.This will initialize COM for multi-threaded object concurrency. Internally, IntraWeb will make a call to CoInitializeEx(nil, COINIT_MULTITHREADED).

Uninitialization is also taken care of automatically when the property is set to something other than ciNone.

Threads and COM

Most COM objects cannot be passed between threads. IntraWeb application are multi threaded HTTP servers that reuse threads, therefore you cannot store references to COM objects between two accesses to the same session or between sessions. Depending on your problem specific, you can either use a COM object in a single operation (not across the whole session, but at one access at a time), then discard it, or marshal the COM interfaces needed by yourselves.

(C) 2002-2009 - Atozed Software Ltd.