473,394 Members | 1,751 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,394 software developers and data experts.

Accessing Existing Vc++ API from .NET C# or VC++.NET

Hi all,
I have doubt regarding .NET.
I have a tool which was developed on VC++ 6.0(Win32 Application ).
The application communicates with library (API) which was developed on
VC++ 6.0 called core client.
I am planning to develop the tool or Win32 application on .NET
platform and I dont' want to migrate the VC++ library (API) to .NET.
The new .NET tool should use the previous VC++ library API ( core
client ).
Is there any possibility to call VC++ 6.0 source file ( .CPP ) or
APIs from .NET ( C# or VC++.NET )..? IF so, would u please suggest me a
usefull link or tell me How can I do it. I dont' want to make the
existing VC++ core client into DLL and add it as a reference to .NET
project.

Thanks for you kindly help
Regards
Kiran

Nov 17 '05 #1
1 1429
<ve*********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
I have doubt regarding .NET.
I have a tool which was developed on VC++ 6.0(Win32 Application ).
The application communicates with library (API) which was developed on
VC++ 6.0 called core client.
I am planning to develop the tool or Win32 application on .NET
platform and I dont' want to migrate the VC++ library (API) to .NET.
The new .NET tool should use the previous VC++ library API ( core
client ).
Is there any possibility to call VC++ 6.0 source file ( .CPP ) or
APIs from .NET ( C# or VC++.NET )..? IF so, would u please suggest me a
usefull link or tell me How can I do it. I dont' want to make the
existing VC++ core client into DLL and add it as a reference to .NET
project.


Well, IMO, the most straight-forward thing to do is to expose a DLL
interface to the library. That done, you can use the facility known as
Platform Invoke from C# as described here:

http://msdn.microsoft.com/library/de...ketutorial.asp

and here:

http://msdn.microsoft.com/library/de...forminvoke.asp

Alternatively you can use Managed C++ (or C++/CLI if you use VS.Net 2005 in
beta now) to create a managed class which can take advantage of what is
called "It just works" (aka IJW) which describes the ability of managed C++
to call unmanaged C++ almost by magic. No other .Net language lets you do
that. That done, your managed C++ class can be consumed by C# clients or
VB.Net clients or any other managed client.

There are issues, however, in developing mixed mode applications. See this
for the details:

http://msdn.microsoft.com/library/de...ingProblem.asp

Regards,
Will
Nov 17 '05 #2

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

Similar topics

5
by: Maett | last post by:
Hi. When I try to compile this piece of Code with VC.NET 2003 // code start #include <vector> template< class T > struct Marker { public:
1
by: Ken Allen | last post by:
We are attempting to replace one of our legacy services (developed in C++) with one that is developed as a C# service. The problem that I am encountering is dealing with the resources that are...
4
by: MSDousti | last post by:
Hi, everyone. I have written this code in Tubo C++ 3.0 earlier, and now I want to port it to VC.NET: int out=0; out=(out & 0xDF); outportb(0x378,out); .... As you see, it seeks to parallel...
2
by: vemulakiran | last post by:
Hi all, I have doubt regarding .NET. I have a tool which was developed on VC++ 6.0(Win32 Application ). The application communicates with library (API) which was developed on VC++ 6.0 called core...
0
by: Edward Diener | last post by:
Scenario: base class in one assembly, derived class in another assembly, __event in base class, testing if event has any handlers in derived class with 'if (OnTestEvent) { //etc. }'. Result:...
0
by: wayne | last post by:
thanks Carl Daniel. :D Carl Daniel wrote: > *wayne wrote: > > Dear all, > > > > may i know how can i delete the contents of an existing file using > > vc++?? also, i would like to know how...
1
by: Rob C | last post by:
We have a client/server application that is written in VC++/MFC. We are trying to integrate with a 3rd party product that exposes its data through a web service. I am trying to figure out the...
5
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the...
1
by: SUJIE | last post by:
Hi all, I have few header, obj and dlls of c++ program. Now i need to instantiate a class and access its objects. though i could include the header, i am not able to link to the dlls.. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.