The New Registered Type Libraries Pane

Once the server is registered you can double check it is in the system by opening the new Registered Type Libraries view of the Delphi IDE, using the corresponding command located under the View menu.

This editor pane lists all registered type libraries (or ActiveX controls) on the system, let's you unregister any of them, register new ones, search the list of type libraries. As you can see below, the list should include our newly registered library:

^ Welcome Page SimpleServer 4

i. SimpleServer.ridi

QsimpleServerJTLS Qriumlmpl ® Type Libraries^_

A4 View "

/x Register ßx Unregister

Q, Search




SENS Events Type Library


C: ^Windows V5ystem32^ens. dll

ServDeps 1.0 Type Library



ServiceSample 1.0 Type Library


city^rogram Files ^Hewlett-Packard ^AM^iin^erviceSample. dll

Setup Kernel l.OType Library


C:\Prograrn File ^.Common Files\[nstallShield\engine^\Iritel Kern el

Setup UI 1,0 Type Library


CiV^rogram Files^ommon Files\InstallShield\engineVj\Iritel 32\user.d

SHGINA l.OType Library



Shockwave Flash



i SimpleServer Library


C: \Users y^larco poajments \books2008 tfiburon'sourcecode '«JOS 'Simple

SkypelCOM 1.0 Type Library.


C: V=ROGRA ~ l\COMMON ~l^Skypel£KrPE4~ 1. DLL

SLCC l.OType Library


C: ^Windows\System32\SLCC .DLL

SLLUALib l.OType Library


C: ^Windows^ystem32^ LLUA, exe

SLUI l.OType Library



SPhoneParser l.OType Library


Cprogram Files^ikype\toolbars^iharedSPhoneParser.dll

SSO engine l.OType Library


c: program Files Hewlett-Packard tfAMlpinlJtSSO.dll

STCIient l.OType Library


C: tyl/indows^ystem 32^trlient dll

STEngine l.OType Library


c: Vrogram Files Hewlett-Packard \IAM \Bin \STEngine .dll

Notice you cannot use this dialog to import a type library or create a client wrapper for it. For this purpose you need to use the revamped type library importer. Select the Component | Import Component menu item, and pick the Type Library option, as shown in the next page:

The next step should be to choose one of the registered types libraries or add a new one. As the list is generally very long, the new search box will come quite handy to find the specific type library you are looking for, in this case one of those with the word "simple" in them:

Delphi Add New Type Library

The following step lets you add the component to a package, generate an import unit, or add it directly to the current project. In any case, you'll end up with a type library import file almost identical to the one generated on the server side by the type library editor (or, to be more precise, by processing the RIDL file).

I've performed the steps above in the SimpleClient project, which is the new edition of another project that was part of Mastering Delphi 2005 and previous volumes of the series. The program creates two COM objects from the server at start up, hooks them to buttons and spin edits, and has a third button for dynamically creating a temporary object. (One of the goals of the original project was to showcase COM objects lifetime, which is why whenever an object is destroyed the server will display a message box).

This is the do-it-all code snippet, which used the generated CoClass: var

Num3: INumberProp; begi n

// create a new temporary COM object Num3 := CoNumberProp.Create; Num3.Va1ue := 100; Num3.Increase;

ShowMessage ('Num3: ' + IntToStr (Num3.Va1ue)); end;

Again, there is very little (if anything) you have to do on the client side of a COM application to move it to Delphi 2009. However, if you are creating a new client project, as I did, you'll probably like the improvements in the type library import wizard.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment