HighTechTalks DotNet Forums  

Re: J# equivalent of C#'s 'typedef' and 'struct' keyword.

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss Re: J# equivalent of C#'s 'typedef' and 'struct' keyword. in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Manuel J. Goyenechea
 
Posts: n/a

Default Re: J# equivalent of C#'s 'typedef' and 'struct' keyword. - 04-29-2004 , 07:37 PM






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


Quote:
"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



Reply With Quote
  #2  
Old   
Bruno Jouhier [MVP]
 
Posts: n/a

Default Re: J# equivalent of C#'s 'typedef' and 'struct' keyword. - 05-01-2004 , 09:50 AM







"Manuel J. Goyenechea" <goya (AT) servertec (DOT) com> a écrit dans le message de
news:OuEagLkLEHA.1264 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
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.

Quote:
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





Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default Re: J# equivalent of C#'s 'typedef' and 'struct' keyword. - 09-03-2004 , 07:11 AM



You can define structs(i.e., Value Types in .net) in J# from Visual
Studio.NET 2005 (Whidbey) onwards as below

public final class Address extends System.ValueType {
public static final String StreetNo = null;
//
public static final String Zip = null;
}

te that you will not be able to do the same in Visual Studio .NET 2002/2003
Current Visual Studio .NET 2005 is in Beta1 and you can install the
corrosponding .Net Framework Version 2.0 Beta1 from
http://www.microsoft.com/downloads/d...595-717C-4EF7-
817B-BDEFD6947019&displaylang=en
ad J# Redist 2.0 Beta1 from
http://www.microsoft.com/downloads/d...3f3-9eaf-4d41-
bad3-9f44fe8e5e81&displaylang=en

Thanks,
Diganta Roy.
Microsoft Visual J# .NET Product Team.

--------------------
Quote:
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
..phx.gbl
Quote:
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







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.