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

Description

Version

Filename

SENS Events Type Library

2.0

C: ^Windows V5ystem32^ens. dll

ServDeps 1.0 Type Library

1,0

C:^Windows^ystem32Vlbem^ervdeps,dll

ServiceSample 1.0 Type Library

1.0

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

Setup Kernel l.OType Library

1.0

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

Setup UI 1,0 Type Library

1,0

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

SHGINA l.OType Library

1.0

C:^Windows^ysterm32^hgina.dll

Shockwave Flash

1.0

C:tyl/indow5^y5tem32V*1acrorned\Flash\Flash9f.oo<

i SimpleServer Library

1,0

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

SkypelCOM 1.0 Type Library.

1.0

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

SLCC l.OType Library

1.0

C: ^Windows\System32\SLCC .DLL

SLLUALib l.OType Library

1,0

C: ^Windows^ystem32^ LLUA, exe

SLUI l.OType Library

1.0

C:tyWndow5\SystEm.32flSLUI.exe

SPhoneParser l.OType Library

1.0

Cprogram Files^ikype\toolbars^iharedSPhoneParser.dll

SSO engine l.OType Library

1,0

c: program Files Hewlett-Packard tfAMlpinlJtSSO.dll

STCIient l.OType Library

1.0

C: tyl/indows^ystem 32^trlient dll

STEngine l.OType Library

1.0

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.

Was this article helpful?

0 0
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