473,406 Members | 2,467 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,406 software developers and data experts.

Interop choices

Hi

I'd appreciate some advice on how to access legacy C++/Win32 libraries
from C#. We have a legacy Win32 application, mostly written in VC7.1,
and we want to re-write the GUI and maybe some business components in
C# (personally, I don't see the need,but the decision has been made).
We still want to keep a sizeable part of the libraries and utilities as
native Win32 libraries.
>From the research I've done so far, I think these are the 4 choices we
can choose from. I'm thinking of proposing 2) for the most
performance-critical interop, 3) for native business components we
don't want to re-write in C# and 4) for the numerous native Win32
general utilities we have.

1) Build native libraries with /clr switch using VC7.1, then access
from C# as .NET assemblies

2) Build native libraries with /clr switch using VC8.0, then access
from C# as .NET assemblies

3) Package native libraries as COM servers and access from C# using COM
Interop service

4) Package native libraries as Win32 DLLs and access from C# using
P/Invoke service

Would be great if someone can offer some advice or references to assist
with the decision we have to make.

Best Regards
Peter

Sep 10 '06 #1
1 1140
1) Build native libraries with /clr switch using VC7.1, then access
from C# as .NET assemblies
Unless you need to run on .NET 1.x, forget this option. C++/CLI is so much
better.
2) Build native libraries with /clr switch using VC8.0, then access
from C# as .NET assemblies

3) Package native libraries as COM servers and access from C# using COM
Interop service

4) Package native libraries as Win32 DLLs and access from C# using
P/Invoke service
#2 beats #4 hands-down, in effort required, performance, etc. You might
want both a native .dll and a C++/CLI assembly which imports that dll. The
C++/CLI wrapper code is more flexible than p/invoke, and leverages your
existing header files, so you can handle many changes in the native code
with a simple recompile.
>
Would be great if someone can offer some advice or references to assist
with the decision we have to make.

Best Regards
Peter

Sep 11 '06 #2

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

Similar topics

0
by: roy | last post by:
I try to call com written in VB 6.0. When I use VS.net Studio to do the debuging, some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation'...
0
by: roy | last post by:
I try to call com written in VB 6.0., some time it works fine, some time I got the following message: Server Error in '/GISOnlineReservation' Application....
0
by: keefah | last post by:
Hi, I'm writing a C# web app that uses Outlook to send email. I use a reference to the Microsoft Outlook 11.0 Object Library, but it's giving me problems. I tracked down some stuff on the Net...
0
by: lacour | last post by:
I can't seem to figure out the difference between adding a COM dll reference in VS2003 and by using TLBIMP. I have a COM dll that references another COM dll, and I want the syntax of my...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
2
by: Jas Manghera | last post by:
Hello everyone, Im having a rather strange problem with my custom ASP.NET application. After deploying the application on a .NET v1.1 computer, the first time the application is launched it can...
2
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a...
1
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox...
2
by: DougS | last post by:
I have an ASP.Net 1.1 app running on my intranet. I want to be able to output a report in Word. I have a .Net dll written for a similar WinForms application. Can I install the Word Interop...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.