Click here to Skip to main content
15,887,917 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i have created com object(activex control) in C#, now i want to embed it into VB.net application.
is it possible?
Posted
Comments
Sergey Alexandrovich Kryukov 12-Nov-13 23:15pm    
Why? why?!
—SA

1 solution

You can do it. And it makes no sense, whatsoever. There are no situations where it could be useful. You want to go a long way, contaminate your register with ActiveX registration, and all that just for nothing.

You need nothing to employ interoperation between assemblies written C# and VB.NET. Both will be .NET assemblies. And there are no any practical barriers between different .NET assemblies. It does not really matter in what language they are written. You simply create an assembly in one language. Create another assembly and add a reference to the first one. Since this moment, all the types and type members marked with public access specifier will become accessible from the referencing assembly, exactly as if they were defined in a single assembly. (Assemblies can also be loaded dynamically during runtime, but, for now, let's say this is an advanced topic.) That's all.

Now, if you don't know assemblies, which is the central point of .NET, references, namespace, and a lot more of the very basic stuff, you cannot really do .NET development. Start learning all that.

And do yourself a big favor: simply forget about COM and ActiveX while doing .NET development. Just forget it, at least for now. You may, as a remote possibility, need to use it for interoperation with non-.NET stuff, but this is not likely. You can always use native DLLs in .NET assemblies without COM/ActiveX. Doing the opposite is much harder, and even that can be done without COM/ActiveX. But you may have good chances to never need it.

—SA
 
Share this answer
 
v3
Comments
Ron Beyer 12-Nov-13 23:33pm    
5'd, with .NET its really easy to inter-operate with assemblies created in other .NET languages (because they all compile down to MSIL in the end). I'm sure the OP is thinking about the old days when you needed ActiveX or COM to communicate from something developed in C++ to something developed in VB6.
Sergey Alexandrovich Kryukov 13-Nov-13 0:24am    
Sure. Thank you, Ron.
—SA

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