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

Using C++ application from C#

Ben
Hi Everyone. I have a legacy C++ app that most certainly won't work if it
was converted to C#. For now, I want to wrap the app in a C++ DLL and use
the app by calling functions within the DLL from a C# GUI. However, I need
to be able to pass a structure of about 50 fields (represented as a class in
C#) to the DLL, and then I need to receive a large array back from the DLL.
Is there a simple way of doing this?
- BEn
Nov 16 '05 #1
1 1057
Check out Marshaling in MSDN. You will have to declare an exact replica of
the structure in C# and marshal the fields appropriately. As for arrays, if
the size of the array is known before-hand, you can specify that to the
Marshaler as well.

-vJ

"Ben" <xt***@helloworld.com> wrote in message
news:jY********************@giganews.com...
Hi Everyone. I have a legacy C++ app that most certainly won't work if it
was converted to C#. For now, I want to wrap the app in a C++ DLL and use
the app by calling functions within the DLL from a C# GUI. However, I
need
to be able to pass a structure of about 50 fields (represented as a class
in
C#) to the DLL, and then I need to receive a large array back from the
DLL.
Is there a simple way of doing this?
- BEn

Nov 16 '05 #2

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

Similar topics

1
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
8
by: inpuarg | last post by:
I 'm developing a c# (.net 2.0) windows forms application and in this application i want to connect to a java servlet page (HTTPS) (which is servlet 2.4 and which may be using Web Based SSO Sun...
1
by: NitinSawant | last post by:
Is there any Visual sourcesafe like application which is web based (can be installed on a remote website) and can be integrated with visual studio .net? Regards, Nitin
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.