Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vemulakiran@gmail.com - 14 Jul 2005 14:06 GMT
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
William DePalo [MVP VC++] - 14 Jul 2005 17:53 GMT
>  I have doubt regarding .NET.
>  I have a tool which was developed on VC++ 6.0(Win32 Application ).
[quoted text clipped - 9 lines]
> 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/default.asp?url=/library/en-us/csref/html/vcwl
kplatforminvoketutorial.asp


and here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conacloserlookatplatforminvoke.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/default.asp?url=/library/en-us/dv_vstechart/ht
ml/vcconMixedDLLLoadingProblem.asp


Regards,
Will

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.