Solved

Using .NET Class Libraries from VC++

Posted on 2006-06-19
4
371 Views
Last Modified: 2010-04-17
Hi,
How can i use a .NET class lib in an exsiting ActiveX code that was made using VC++?
0
Comment
Question by:jyotishb
4 Comments
 
LVL 11

Accepted Solution

by:
pratap_r earned 250 total points
ID: 16935787
you need to make the .Net compatible with unmanaged code(eg, activex). Use tblexp utility for that, it creates a wraper for you.

examples here:
http://samples.gotdotnet.com/quickstart/howto/doc/Interop/Building_Samples_COM2NET.aspx
http://www.codeproject.com/managedcpp/unmanaged_to_managed.asp
http://www.codeproject.com/csharp/ManagedCOM.asp

syntax for tblexp here
http://msdn2.microsoft.com/en-us/library/hfzzah2c.aspx

Have Fun!
Pratap
0
 
LVL 2

Assisted Solution

by:deepakgupta111
deepakgupta111 earned 250 total points
ID: 16969051
One way that I have used is
Make a Bridge dll (a managed C++ DLL), which load the .Net lib in AppDomain.
Now for calling any .net lib function from your C++ module,
From C++ make a call to Bridge DLL function, which eventually makes the call to .net functions in the lib loaded in its AppDomain.

C++ Module ==> Bridge DLL ==> .net Lib
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

735 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