Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET1.1 .NET2.0 .NET3.0 C# .NET , +
i have created com object(activex control) in C#, now i want to embed it into VB.net application.
is it possible?
Posted 12-Nov-13 16:41pm
Comments
Sergey Alexandrovich Kryukov at 12-Nov-13 23:15pm
   
Why? why?!
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v3
Comments
Ron Beyer at 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 at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 459
1 Nirav Prabtani 338
2 Abhinav S 170
3 PIEBALDconsult 160
4 Pikoh 140
0 OriginalGriff 7,640
1 Sergey Alexandrovich Kryukov 6,836
2 Maciej Los 3,919
3 Peter Leow 3,698
4 CHill60 2,742


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 12 Nov 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100