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

porting legacy C++ enums to managed object?

Is there any way to port legacy C++ enum to managed object?
For example, let's assume there is a C++ header file(we cannot modify it,
because it is updated by other vendor). It has a enum definition like this.

enum AAA { a,b,c };

Assuming that we made a managed DLL whose namespace id MyLib. I tried
several way such as

typedef __gc AAA MyAAA;

and it generates just syntax errors.

Please reply. Thanks in advance.

Regards,
Hyun-jik Bae
Nov 17 '05 #1
1 1251
I believe you have to create an independent managed enum, which
duplicates its unmanaged counterpart, and helper functions that convert
back and forth between them, using a switch, or maybe a bunch of ifs.
It's a part of the wrapping work. I'm not sure if there are tools that
auto generate managed code that wraps unmanaged enums, structs and
classes. Often it couldn't be 100% automated anyway.

Tom

Bae,Hyun-jik wrote:
Is there any way to port legacy C++ enum to managed object?
For example, let's assume there is a C++ header file(we cannot modify it,
because it is updated by other vendor). It has a enum definition like this.

enum AAA { a,b,c };

Assuming that we made a managed DLL whose namespace id MyLib. I tried
several way such as

typedef __gc AAA MyAAA;

and it generates just syntax errors.

Please reply. Thanks in advance.

Regards,
Hyun-jik Bae

Nov 17 '05 #2

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

Similar topics

1
by: steve clark | last post by:
We've noticed that invocations of legacy C++ COM DLLs from .NET (Managed C++ or C#) desktop applications is quite a bit slower than the same calls from good old native C++. Does anybody have...
3
by: Sai Kit Tong | last post by:
Hi, I am developing a new application running on Windows platform that needs to interface with existing legacy code - written in basic C / C++. I am trying to evaluate Java vs C#...
3
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached...
4
by: Sai Kit Tong | last post by:
I have to interface managed application with my legacy dll. I have employed the wrapper approach but I have to deal with the asynchronous callback from the legacy dll, which likely goes through a...
1
by: omantawy | last post by:
Hi, I have some legacy ASP web applications that use an unmanaged COM component to connect to a third party application. The third part application has moved to the managed code in the current...
8
by: Bern McCarty | last post by:
I have a simple ref class in its own namespace that needs to coexist with a legacy typedef alias for "unsigned int" in the global namespace that has the identifier as itself. Everything compiles...
6
by: =?Utf-8?B?RGlwZXNoX1NoYXJtYQ==?= | last post by:
Hi all, I am porting an code written in VC++ to VC.Net to make it manage. But in Managed VC we dont use "const" keyboard at all. but my code is using it very frequently, so is their any...
3
by: James Egan | last post by:
I'm porting a legacy application from HP-UX to Linux. The va_start macro takes one argument under HP-UX, but takes two under Linux: va_start under HP-UX takes only one var: hp:/home/fredgrep...
13
by: aarklon | last post by:
Hi all, arrays are guaranteed to be contiguous with no padding before or after any array member , but what about enums ..???
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: 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:
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
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
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.