Solved

Can you make a activeX component in .net?

Posted on 2003-11-25
8
226 Views
Last Modified: 2009-07-29
I know its possible to make a .net component, but to knownledge they can only be used it .net compatiable languages. I need a component to work in C++.


Kind Regards

Tom
0
Comment
Question by:tomcoombs
  • 4
8 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
" know its possible to make a .net component, but to knownledge they can only be used it .net compatiable languages."   this is NOT quite correct.  It is possible for a VS.NET to create a .NET DLL, with an ActiveX wrapper, so it LOOKS like an ActiveX DLL.  But is you are talking about build a CONTROL, in .NET, that can be used in C++, then you are correct.  

0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 125 total points
Comment Utility
lookup "Com Wrappers" in the .NET Help system.

to wit:

"COM differs from the .NET Framework object model in several important ways:

Clients of COM objects must manage the lifetime of those objects; the common language runtime manages the lifetime of objects in its environment.
Clients of COM objects discover whether a service is available by requesting an interface that provides that service and getting back an interface pointer, or not. Clients of .NET objects can obtain a description of an object's functionality using reflection.
NET objects reside in memory managed by the .NET Framework execution environment. The execution environment can move objects around in memory for performance reasons and update all references to the objects it moves. Unmanaged clients, having obtained a pointer to an object, rely on the object to remain at the same location. These clients have no mechanism for dealing with an object whose location is not fixed.
To overcome these differences, the runtime provides wrapper classes to make both managed and unmanaged clients think they are calling objects within their respective environment. Whenever your managed client calls a method on a COM object, the runtime creates a runtime callable wrapper (RCW). RCWs abstract the differences between managed and unmanaged reference mechanisms, among other things. The runtime also creates a COM callable wrapper (CCW) to reverse the process, enabling a COM client to seamlessly call a method on a .NET object. As the following illustration shows, the perspective of the calling code determines which wrapper class the runtime creates."



AW
0
 

Author Comment

by:tomcoombs
Comment Utility
Good info, and I can select the "make COM wrapper" option in the project setings to do that. But how do I register it as an ActiveX component to say, view it in the activeX test container.

I understand activeX control implement certain interfaces (IOleControl etc).


Thanks

Tom
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
using RegAsm - you are actually Registering the Assembly.

AW
0
 

Expert Comment

by:tom_coombs
Comment Utility
Thanks again, this I feel that this is getting closer...

Done that, all worked. (Registered the tlb file)  But I still do not have a registered activeX control when looking in the test container.

Back to your prev point, which could prove that this task is simpley not possible (in which .net has taken a step backwards!!) :

"It is possible for a VS.NET to create a .NET DLL, with an ActiveX wrapper, so it LOOKS like an ActiveX DLL.  But is you are talking about build a CONTROL, in .NET, that can be used in C++, then you are correct. " -  I thought activeX was a universally sharable CONTROL built using COM techniques, or am I wrong?

Any other ideas? Have you actually ever managed to create a .net usercontrol dll and somehow run it in the activeX container?



Regards

Tom
0
 
LVL 44

Expert Comment

by:Arthur_Wood
Comment Utility
as I stated, it is NOT possible to create a .NET UserControl that is accesible from COM.  ActiveX DLLs are 'universally accessible', but .NET is not capable of creating a CONTROL that has a COM-WRAPPER. Sorry about that.

AW
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now