Click here to Skip to main content
15,791,602 members
Home / Discussions / C#
   

C#

 
GeneralRe: Pure Tones - Sound generation from scratch. Pin
Richard Deeming7-Feb-03 1:16
mveRichard Deeming7-Feb-03 1:16 
GeneralGuid and String Pin
devvvy7-Feb-03 0:30
devvvy7-Feb-03 0:30 
GeneralRe: Guid and String Pin
StephanBoome7-Feb-03 1:51
StephanBoome7-Feb-03 1:51 
GeneralRe: Guid and String Pin
devvvy7-Feb-03 1:53
devvvy7-Feb-03 1:53 
Questionpossibly a question without a awnser ? Pin
jtmtv187-Feb-03 0:11
jtmtv187-Feb-03 0:11 
AnswerRe: possibly a question without a awnser ? Pin
Philip Fitzsimons7-Feb-03 0:37
Philip Fitzsimons7-Feb-03 0:37 
GeneralRe: possibly a question without a awnser ? Pin
leppie7-Feb-03 12:09
leppie7-Feb-03 12:09 
QuestionStructure array is the member another structure? Pin
JuhaKa7-Feb-03 0:03
JuhaKa7-Feb-03 0: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 12:19
leppie7-Feb-03 12:19 
GeneralException creating a control Pin
chito6-Feb-03 17:03
chito6-Feb-03 17:03 
GeneralRe: Exception creating a control Pin
James T. Johnson6-Feb-03 19:42
James T. Johnson6-Feb-03 19:42 
QuestionHow can I make Command at runtime? Pin
bania6-Feb-03 16:40
bania6-Feb-03 16:40 
AnswerRe: How can I make Command at runtime? Pin
leppie6-Feb-03 22:53
leppie6-Feb-03 22:53 
GeneralThanks a lot!! Pin
bania7-Feb-03 4:32
bania7-Feb-03 4:32 
Questionassociate an object with datagrid's row ? Pin
Paresh Gheewala6-Feb-03 15:11
Paresh Gheewala6-Feb-03 15:11 
QuestionDrawString Diagonally on Image object? Pin
wkoch6-Feb-03 11:23
wkoch6-Feb-03 11:23 
AnswerRe: DrawString Diagonally on Image object? Pin
Paresh Gheewala6-Feb-03 11:43
Paresh Gheewala6-Feb-03 11:43 
AnswerRe: DrawString Diagonally on Image object? Pin
James T. Johnson6-Feb-03 16:37
James T. Johnson6-Feb-03 16:37 
GeneralRe: DrawString Diagonally on Image object? Pin
b99koch17-Mar-03 10:58
sussb99koch17-Mar-03 10:58 
GeneralManaged DirectDraw Pin
Tomas Petricek6-Feb-03 10:49
Tomas Petricek6-Feb-03 10:49 
GeneralUsing Bitmap.Save(FileName, ImageFormat.Icon) Pin
draco_iii6-Feb-03 9:28
draco_iii6-Feb-03 9:28 
GeneralRe: Using Bitmap.Save(FileName, ImageFormat.Icon) Pin
Paresh Gheewala6-Feb-03 10:32
Paresh Gheewala6-Feb-03 10:32 
GeneralRe: Using Bitmap.Save(FileName, ImageFormat.Icon) Pin
draco_iii6-Feb-03 12:55
draco_iii6-Feb-03 12:55 
GeneralWhich PixelFormat. to use Pin
draco_iii6-Feb-03 15:54
draco_iii6-Feb-03 15:54 
GeneralShow System Menu on a borderless form Pin
Peter Dedene6-Feb-03 8:58
Peter Dedene6-Feb-03 8: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.