 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Salman Guest
|
Posted: Wed Dec 06, 2006 10:09 pm Post subject: Wrapper of activex for existing unit |
|
|
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. |
|
| Back to top |
|
 |
Wim Coenen Guest
|
Posted: Thu Dec 07, 2006 10:37 pm Post subject: Re: Wrapper of activex for existing unit |
|
|
Salman wrote:
| Quote: | 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.
|
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. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|