Solved

Using .NET Class Libraries from VC++

Posted on 2006-06-19
4
376 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Progress
Introduction to Processes

622 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