Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using .NET Class Libraries from VC++

Posted on 2006-06-19
4
Medium Priority
?
385 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 1000 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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

963 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