Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Wrapper of activex for existing unit

2 views
Skip to first unread message

Salman

unread,
Dec 6, 2006, 11:09:12 AM12/6/06
to
I have a working Delphi unit, which works fine after including in any
Delphi application. However, now I want to use this functionality in
another application that is written in VB.NET/C#. Due to this reason, I
want to make this unit in an ActiveX and then import this to .NET.

Is there anyone who can guide me how to do that?

By the way, the unit file is based on socket programming.

Thansk,

Salman Bajwa.

Wim Coenen

unread,
Dec 7, 2006, 11:37:32 AM12/7/06
to

In short:

Use "File - New" to create a new ActiveX library. In Borland Developer
Studio 2006,
it can be found under "Other - Delphi projects - ActiveX". Then use
"File - New"
again to create a new COM object in this ActiveX library.

Your new COM object "Foo" with COM interface "IFoo" will be generated
as the delphi
class "TFoo". Now add a "uses" reference to the unit you want to wrap,
and use the type
library editor to add methods to "IFoo". Implement those methods in
TFoo to expose
the functionality of your unit.

The resulting COM library can be wrapped by a .NET assembly with the
tlbimp utility.
Try "tlbimp /?" in a console.

Good luck,
WIC.

0 new messages