Solved

Using .NET Class Libraries from VC++

Posted on 2006-06-19
4
366 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How Complex Is This Java Course ? 9 95
split53 challenge 7 80
mapShare challenge 13 91
How  do I get an older program to run in Windows 10? 20 104
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

863 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

25 Experts available now in Live!

Get 1:1 Help Now