Click here to Skip to main content
16,020,714 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pure Tones - Sound generation from scratch. Pin
Richard Deeming7-Feb-03 0:16
mveRichard Deeming7-Feb-03 0:16 
GeneralGuid and String Pin
devvvy6-Feb-03 23:30
devvvy6-Feb-03 23:30 
GeneralRe: Guid and String Pin
StephanBoome7-Feb-03 0:51
StephanBoome7-Feb-03 0:51 
GeneralRe: Guid and String Pin
devvvy7-Feb-03 0:53
devvvy7-Feb-03 0:53 
Questionpossibly a question without a awnser ? Pin
jtmtv186-Feb-03 23:11
jtmtv186-Feb-03 23:11 
AnswerRe: possibly a question without a awnser ? Pin
Philip Fitzsimons6-Feb-03 23:37
Philip Fitzsimons6-Feb-03 23:37 
GeneralRe: possibly a question without a awnser ? Pin
leppie7-Feb-03 11:09
leppie7-Feb-03 11:09 
QuestionStructure array is the member another structure? Pin
JuhaKa6-Feb-03 23:03
JuhaKa6-Feb-03 23:03 
Hi!

I have four 'basic' structures, and I have one 'collection' structure, which contains my 'basic' structures. This works fine until I make a structure array into my 'collection' structure. So, now I'm asking help, how should I define this structure array inside another structure?


See code:

using System;<br />
using System.Runtime.InteropServices;<br />
using Microsoft.Win32;<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class MSSD<br />
{		<br />
	public byte msf;<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
	public byte[] mso;<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
	public byte[] ovn;<br />
	public byte br;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class FHPD<br />
{<br />
	public byte spul;<br />
	public byte spm;<br />
	public byte spss;<br />
	public byte spls;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class RHPD<br />
{<br />
	public byte spul;<br />
	public byte spm;<br />
	public byte spss;<br />
	public byte spls;<br />
	public byte sps;<br />
	public byte spd;<br />
	public byte ac;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public class HPD<br />
{<br />
	public byte csr;<br />
	public byte csl;<br />
	public byte cgr;<br />
	public byte crl;<br />
	public byte rtron;<br />
	public byte rtroff;<br />
	public byte rtlon;<br />
	public byte rtloff;<br />
	public byte moo;<br />
	public byte arf;<br />
	public byte alf;<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
	public uint[] qrp;<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]<br />
	public uint[] qlp;<br />
}<br />
<br />
[StructLayout(LayoutKind.Sequential)]<br />
public sealed class PAD<br />
{<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]<br />
	public byte[] sn;<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]<br />
	public byte[] ct;<br />
	[MarshalAs(UnmanagedType.Struct)]<br />
	public MSSD mss = new MSSD();<br />
	[MarshalAs(UnmanagedType.Struct)]<br />
	public FHPD fhpd = new FHPD();<br />
	[MarshalAs(UnmanagedType.Struct)]<br />
	public RHPD rhpd = new RHPD();<br />
	[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.Struct)]//the problem<br />
	public HPD[] hpd;<br />
<br />
	public PAD()<br />
	{<br />
<br />
	}<br />
<br />
	public void sizeOfPAD()<br />
	{<br />
		int si = Marshal.SizeOf(this);<br />
		Console.WriteLine("the size of PAD is " + si +" bytes.");<br />
	}<br />
}





Please, help me!

br. Juha Ka
AnswerRe: Structure array is the member another structure? Pin
leppie7-Feb-03 11:19
leppie7-Feb-03 11:19 
GeneralException creating a control Pin
chito6-Feb-03 16:03
chito6-Feb-03 16:03 
GeneralRe: Exception creating a control Pin
James T. Johnson6-Feb-03 18:42
James T. Johnson6-Feb-03 18:42 
QuestionHow can I make Command at runtime? Pin
bania6-Feb-03 15:40
bania6-Feb-03 15:40 
AnswerRe: How can I make Command at runtime? Pin
leppie6-Feb-03 21:53
leppie6-Feb-03 21:53 
GeneralThanks a lot!! Pin
bania7-Feb-03 3:32
bania7-Feb-03 3:32 
Questionassociate an object with datagrid's row ? Pin
Paresh Gheewala6-Feb-03 14:11
Paresh Gheewala6-Feb-03 14:11 
QuestionDrawString Diagonally on Image object? Pin
wkoch6-Feb-03 10:23
wkoch6-Feb-03 10:23 
AnswerRe: DrawString Diagonally on Image object? Pin
Paresh Gheewala6-Feb-03 10:43
Paresh Gheewala6-Feb-03 10:43 
AnswerRe: DrawString Diagonally on Image object? Pin
James T. Johnson6-Feb-03 15:37
James T. Johnson6-Feb-03 15:37 
GeneralRe: DrawString Diagonally on Image object? Pin
b99koch17-Mar-03 9:58
sussb99koch17-Mar-03 9:58 
GeneralManaged DirectDraw Pin
Tomas Petricek6-Feb-03 9:49
Tomas Petricek6-Feb-03 9:49 
GeneralUsing Bitmap.Save(FileName, ImageFormat.Icon) Pin
draco_iii6-Feb-03 8:28
draco_iii6-Feb-03 8:28 
GeneralRe: Using Bitmap.Save(FileName, ImageFormat.Icon) Pin
Paresh Gheewala6-Feb-03 9:32
Paresh Gheewala6-Feb-03 9:32 
GeneralRe: Using Bitmap.Save(FileName, ImageFormat.Icon) Pin
draco_iii6-Feb-03 11:55
draco_iii6-Feb-03 11:55 
GeneralWhich PixelFormat. to use Pin
draco_iii6-Feb-03 14:54
draco_iii6-Feb-03 14:54 
GeneralShow System Menu on a borderless form Pin
Peter Dedene6-Feb-03 7:58
Peter Dedene6-Feb-03 7:58 

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.