Click here to Skip to main content
15,884,970 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello everyone,

My previous question was maybe not so good formulated.
I will explain my query as follow:

Do you know how to simulate in C#, a VB6 Activex EXE Standalone application which exposes a com visible object (IDispatch wrapper class) already instanced in the 'activex exe like' c# application? The clients accessing it via creatobject / getobject will always get a reference on this object.

This does not seem to be so straight forward as I experimented in vb.net.
Is it related to .net interop ?

If I understand the best way will be to expose a .NET Remoting object (application life time) then creating a COM interop class library which will be used like a tunnel between the two communication solutions.

Is it what you have in mind ?

Hope this will help you to understand my question.

Any inputs you could share for this are really welcome ?

Thank you so much in advance.
Posted
Updated 26-Oct-11 22:41pm
v4

The closest equivalent would be a Windows service that exposes a WCF service (or remoting) interface.

That said you could use COM interop to consume your VB6 ActiveX exe directly if you so prefer.
 
Share this answer
 
Comments
Espen Harlinn 26-Oct-11 20:12pm    
Good reply :)
SuperMiQi 27-Oct-11 4:40am    
Hello,

If I understand the best way will be to expose a .NET Remoting object (application life time) then creating a COM interop class library which will be used like a bridge/connection between the two communications solution.

Is it what you have in mind ?
Thank you so much in advance.
SuperMiQi 27-Oct-11 5:05am    
If I understand the best way will be to expose a .NET Remoting object (application life time) then creating a COM interop class library which will be used like a tunnel between the two communication solutions.

Is it what you have in mind ?
First, the term "static object" is a misnomer. A static class cannot be instantiated in .Net.
You can expose a static method or class in .Net.

Instead of CreateObject you can use the new keyword and that will create an instance of a class for you.

In case you don't want to do all this, you can still use your ActiveX dll in C# using Com Interop[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Oct-11 14:52pm    
Abhinav, where did you see "static object" in the question? Please understand, "static object" is not a misnomer, but "object of static class" would be. These too things are not the same; and a static object is a usual thing. But who mentioned this object of static class?
--SA
Sergey Alexandrovich Kryukov 26-Oct-11 14:56pm    
OK, I looked at the first version of the OP's question and found a mention of "static object" there. No, there is nothing fundamentally wrong with this idea. Of course, practically, exposing of a static object by a class library is quite a bad design, but not a misnomer or something. (So, I did not vote this time.)
--SA
Abhinav S 27-Oct-11 1:03am    
Ok. I still don't quite get the concept static object.
How will you generate a 'static object'? Anyway, we might actually digressing away from the OP's initial question a little.
SuperMiQi 27-Oct-11 5:06am    
If I understand the best way will be to expose a .NET Remoting object (application life time) then creating a COM interop class library which will be used like a tunnel between the two communication solutions.

Is it what you have in mind ?
Espen Harlinn 26-Oct-11 20:14pm    
Nice reply :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900