Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
QuestionHow to make Make and IDE??? Pin
ilmian13-Jul-04 19:25
ilmian13-Jul-04 19:25 
Generalworking with https Pin
niko.13-Jul-04 17:51
sussniko.13-Jul-04 17:51 
GeneralRe: working with https Pin
Heath Stewart14-Jul-04 4:37
protectorHeath Stewart14-Jul-04 4:37 
GeneralRe: working with https Pin
Anonymous14-Jul-04 6:31
Anonymous14-Jul-04 6:31 
QuestionHow to use UdpClient class? Pin
skywen13-Jul-04 17:00
skywen13-Jul-04 17:00 
AnswerRe: How to use UdpClient class? Pin
Heath Stewart14-Jul-04 4:24
protectorHeath Stewart14-Jul-04 4:24 
GeneralChild Control Painting problem(For the last time) Pin
Jon_Slaughter13-Jul-04 13:54
Jon_Slaughter13-Jul-04 13:54 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 4:12
protectorHeath Stewart14-Jul-04 4:12 
GeneralRe: Child Control Painting problem(For the last time) Pin
Jon_Slaughter14-Jul-04 5:28
Jon_Slaughter14-Jul-04 5:28 
GeneralRe: Child Control Painting problem(For the last time) Pin
Heath Stewart14-Jul-04 6:01
protectorHeath Stewart14-Jul-04 6:01 
GeneralBigger ImageList Pin
blankg13-Jul-04 11:50
blankg13-Jul-04 11:50 
GeneralRe: Bigger ImageList Pin
Heath Stewart14-Jul-04 4:01
protectorHeath Stewart14-Jul-04 4:01 
Generaldisable network card throw c# Pin
vipervip13-Jul-04 11:06
vipervip13-Jul-04 11:06 
Generalconfig file in console app to store connection string help Pin
mtbjr13-Jul-04 10:25
mtbjr13-Jul-04 10:25 
GeneralRe: config file in console app to store connection string help Pin
Heath Stewart14-Jul-04 3:56
protectorHeath Stewart14-Jul-04 3:56 
GeneralPointers and dereferencing Pin
frank29713-Jul-04 8:01
frank29713-Jul-04 8:01 
GeneralRe: Pointers and dereferencing Pin
Heath Stewart13-Jul-04 8:34
protectorHeath Stewart13-Jul-04 8:34 
Generalcapturing events when application closes Pin
vista2713-Jul-04 7:59
vista2713-Jul-04 7:59 
GeneralRe: capturing events when application closes Pin
Heath Stewart13-Jul-04 9:07
protectorHeath Stewart13-Jul-04 9:07 
GeneralArray of Struct within Struct Pin
Uday Shastri13-Jul-04 7:58
Uday Shastri13-Jul-04 7:58 
//CONSTANTS
public const int IS3K_SHORT_DESCRIPTION_MAX = 20 ;
public const int IS3K_LONG_DESCRIPTION_MAX = 50 ;
public const int IS3K_LINE_KEY_MAX = 12 ;
public const int IS3K_LINES_PER_SHOW = 20 ;

//STRUCT DECLARATION
[StructLayout(LayoutKind.Sequential)]
public struct _IS3kLineDescription
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst= IS3K_LINE_KEY_MAX , ArraySubType = UnmanagedType.U1)]
public byte[] LineKey;
[MarshalAs(UnmanagedType.ByValArray, SizeConst= IS3K_SHORT_DESCRIPTION_MAX , ArraySubType = UnmanagedType.U1)]
public byte [] LongDescription;
[MarshalAs(UnmanagedType.ByValArray, SizeConst= IS3K_LONG_DESCRIPTION_MAX , ArraySubType = UnmanagedType.U1)]
public byte [] ShortDescription;
}

[StructLayout(LayoutKind.Sequential)]
public struct _IS3kShowLines
{
public int Command;
public int Flag;
public int TotalLines;
public int TopLine;
[MarshalAs(UnmanagedType.ByValArray, SizeConst= IS3K_LONG_DESCRIPTION_MAX , ArraySubType = UnmanagedType.Struct) ]
public _IS3kLineDescription[] Line;
};


//Implementaion code
_IS3kShowLines showLines = new _IS3kShowLines() ;
_IS3kLineDescription oneLineDescription = new _IS3kLineDescription();
int x,y;

//this one is working ok
y = Marshal.SizeOf(oneLineDescription );

//this one does not,
//as there is array of struct within struct
//program dies.
//An unhandled exception of type 'System.ArgumentException' occurred in
//Additional information: Type _IS3kShowLines can not be marshaled as
//unmanaged structure; no meaningful size or offset can be computed.

x = Marshal.SizeOf(showLines );


Can anyone please tell why second SizeOf does not work
my intention is find out sizeof showLines variable
thanks
Uday Shastri
GeneralRe: Array of Struct within Struct Pin
Heath Stewart13-Jul-04 9:21
protectorHeath Stewart13-Jul-04 9:21 
GeneralRe: Array of Struct within Struct Pin
Uday Shastri13-Jul-04 9:47
Uday Shastri13-Jul-04 9:47 
GeneralRe: Array of Struct within Struct Pin
Heath Stewart13-Jul-04 10:19
protectorHeath Stewart13-Jul-04 10:19 
Generalupload files Pin
Steven M Hunt13-Jul-04 7:03
Steven M Hunt13-Jul-04 7:03 
GeneralRe: upload files Pin
Heath Stewart13-Jul-04 9:17
protectorHeath Stewart13-Jul-04 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.