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 / .NET Framework / CLR / October 2003

Tip: Looking for answers? Try searching our database.

managed enumerations out of unmanaged ones

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
marek - 30 Sep 2003 10:27 GMT
Hello All,

    I'm doing web app that will use very strongly
classes implemented in 'unamanaged' VC++. Thus I wrap
these classes with mananaged wrappers and only then I use
them in C# implementation of server actions. The only
thing that I cannot bite are unmanaged enumerations.
Can anyone tell me how to wrap unmanaged enumerations
types to be abel to use them in C# code. Of course I would
like to avoid rewriting a huge .h file with unamanged enum
types definitions. Any sensible sygestions appreciated.

Greetings
Marek
"Shawn Rothlisberger" - 30 Sep 2003 21:51 GMT
Put "__value" before your enum statement.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks
Shawn Rothlisberger
CLR Performance Test
marek - 01 Oct 2003 08:03 GMT
Hi,

      Thanks for replying for my question.
Actually the __value word doesn't solve my problem
since still I need to retype all enumeration types
definitions in another file. This way I will have to have
still two files with actualy the same types definitions
to maintain. This I would like to avoid. More precisely
formulated question is how to wrap already defined
unmanaged enumeration types definitions with some wrapper
in managed code so that redefinition is not required.

greetings
Marek

>-----Original Message-----
>Put "__value" before your enum statement.
[quoted text clipped - 7 lines]
>
>.
Mattias Sj?gren - 02 Oct 2003 00:18 GMT
Marek,

>       Thanks for replying for my question.
>Actually the __value word doesn't solve my problem
>since still I need to retype all enumeration types
>definitions in another file. This way I will have to have
>still two files with actualy the same types definitions
>to maintain. This I would like to avoid.

Can't you solve that with a hack similar to this

#define enum __value enum
#include <YourExistingEnums.h>
#undef enum

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

marek - 06 Oct 2003 10:01 GMT
Indeed ...  shame on me ...
that I dodn't have this idea myself.

thanks
Marek

>-----Original Message-----
>Marek,
[quoted text clipped - 13 lines]
>
>Mattias

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.