![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
"Pushpendra Vishwakarma" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:6D2624D5-14AA-4040-8B75-A0ADEF7BFC77 (AT) microsoft (DOT) com... Hi, Are there any equivalent keywords in J# for C#'s 'typedef' and 'struct' ? Thanks, Pushpendra |
#2
| |||
| |||
|
|
Pushpendra, MIDL supports typedef, C/C++ supports typedef, but as far as I know C# does not support typedef. You may want to try using the preprocessor. For example: #define unsigned_int System.UInt32. |
|
Or you may directly use the J# equivalent data type for that typedef. For example System.UInt32 l_unsigned_int; If you mean typeof then you can use .class.ToType(). For example myobject.class.ToType(). For structs use the StructLayout attribute and create a class. Here is an example of the Win32 API SYSTEMTIME structure in J#: /** @attribute StructLayout(LayoutKind.Sequential) */ public class SystemTime { public System.UInt16 wYear; public System.UInt16 wMonth; public System.UInt16 wDayOfWeek; public System.UInt16 wDay; public System.UInt16 wHour; public System.UInt16 wMinute; public System.UInt16 wSecond; public System.UInt16 wMiliseconds; } Have fun, Manny "Pushpendra Vishwakarma" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:6D2624D5-14AA-4040-8B75-A0ADEF7BFC77 (AT) microsoft (DOT) com... Hi, Are there any equivalent keywords in J# for C#'s 'typedef' and 'struct' ? Thanks, Pushpendra |
#3
| |||
| |||
|
|
From: "Bruno Jouhier [MVP]" <bjouhier (AT) club-internet (DOT) fr References: <6D2624D5-14AA-4040-8B75-A0ADEF7BFC77 (AT) microsoft (DOT) com OuEagLkLEHA.1264 (AT) TK2MSFTNGP12 (DOT) phx.gbl Subject: Re: J# equivalent of C#'s 'typedef' and 'struct' keyword. Date: Sat, 1 May 2004 15:50:51 +0200 Lines: 56 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Message-ID: <#fDiZN4LEHA.2784 (AT) TK2MSFTNGP10 (DOT) phx.gbl Newsgroups: microsoft.public.dotnet.vjsharp NNTP-Posting-Host: l01m-23-100.d2.club-internet.fr 195.36.194.100 Path: cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP10 |
|
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.vjsharp:5989 X-Tomcat-NG: microsoft.public.dotnet.vjsharp "Manuel J. Goyenechea" <goya (AT) servertec (DOT) com> a écrit dans le message de news:OuEagLkLEHA.1264 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Pushpendra, MIDL supports typedef, C/C++ supports typedef, but as far as I know C# does not support typedef. You may want to try using the preprocessor. For example: #define unsigned_int System.UInt32. The J# and C# preprocessor does not support this style of #define (they don't support any form of macro). So, this won't work! Bruno. Or you may directly use the J# equivalent data type for that typedef. For example System.UInt32 l_unsigned_int; If you mean typeof then you can use .class.ToType(). For example myobject.class.ToType(). For structs use the StructLayout attribute and create a class. Here is an example of the Win32 API SYSTEMTIME structure in J#: /** @attribute StructLayout(LayoutKind.Sequential) */ public class SystemTime { public System.UInt16 wYear; public System.UInt16 wMonth; public System.UInt16 wDayOfWeek; public System.UInt16 wDay; public System.UInt16 wHour; public System.UInt16 wMinute; public System.UInt16 wSecond; public System.UInt16 wMiliseconds; } Have fun, Manny "Pushpendra Vishwakarma" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:6D2624D5-14AA-4040-8B75-A0ADEF7BFC77 (AT) microsoft (DOT) com... Hi, Are there any equivalent keywords in J# for C#'s 'typedef' and 'struct' ? Thanks, Pushpendra |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |