473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to add any dotnet component in vc++

hi how to add any dotnet component like we add in c#.
and what path to set. bye

--
With regards,

Gangani Kanaiya.
Nov 17 '05 #1
1 1497
First off I am not sure if you are referring to adding assemblies to managed C++ or you are trying to do interop from unmanaged code directly to managed code. So I'll talk a bit about both:

So real quick, adding .Net assemblies to managed C++ is much like adding them in C#, the syntax is different but both share the same notions
C#
using System.Xml
MC++
#using <mscorlib.dll
#using<System.Xml.dll

using namespace System::Xml

The environment variable LIBPATH is used to search for assembles referenced in the #using directive. You can specify the path in the #using directive as well. The .Net framework directory is also used to lookup assemblies as well.

Now to use from unmanaged code you have two choices
1) Use gcroot templates to define unmanaged objects with access to managed objects
2) Use TLBExp to make COM callable wrappers to use from unmanaged code

I only use the first option if I really have to. The code to do this can get a little tricky as it involves carefully sequestering of references to managed classes in your unamanaged code. So in general if I can get away with it, I use COM interop to access .Net objects. Now then, not all .Net objects are easy to use from COM land (basically you can create .Net objects from COM if they have default constructors, you can use them as long as they don't have vital static methods you need access to)

Hope this helped
Kevi

----- Kanaiya wrote: ----

hi how to add any dotnet component like we add in c#
and what path to set. by

--
With regards

Gangani Kanaiya

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: brazilnut52 | last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better I have created a simple COM DLL in .NET by using the COM class...
5
by: Grant Schenck | last post by:
Hello, I built an MTA which is used from an ASA and ASP pages. The MTA was developed in VC++ 6.0. How would I go about debugging into the C++ code? Thanks, Grant Schenck
1
by: Kanaiya | last post by:
hi how to add dotnet component in c++ which is develop in c# -- With regards, Gangani Kanaiya.
4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
0
by: Severino | last post by:
Hi all, we have developed a .NET component for use inside Windows Forms: this component has been written using VC++.NET (2003) and is working perfectly when inserted inside VC#.NET or VB.NET...
0
by: abbie10 | last post by:
Hi, I am unable to add a non 3rd party custom component(an OGX file) to my MFC app in vc++.net. In vc6.0,it was done using Project->Add to project->Components and Controls. But i don't find that...
0
by: Severino | last post by:
Hi all, we have developed a .NET component for use inside Windows Forms: this component has been written using VC++.NET (2003) and is working perfectly when inserted inside VC#.NET or VB.NET...
1
by: Rami Atia | last post by:
Hi, I am new to VC++ and want to learn how to write COM component with VC++ I've been written lots of component in the past with VB6, but want to migrate them to VC++.NET Is there a book that...
3
by: iyengar.sheshadri | last post by:
Hi All, Currently we have COM component(dll) implemented using ATL. Because of the current business requirements, we would like to rewrite the COM component in Managed C++ and the clients will...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.