Click here to Skip to main content
15,887,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: help needed for voip Pin
J4amieC29-Sep-09 23:38
J4amieC29-Sep-09 23:38 
GeneralRe: help needed for voip Pin
aamirzada30-Sep-09 0:44
aamirzada30-Sep-09 0:44 
AnswerRe: help needed for voip Pin
Christian Graus29-Sep-09 22:10
protectorChristian Graus29-Sep-09 22:10 
Questiondetect javascript code for google ad sense Pin
Anil Veeraghattapu 429-Sep-09 21:29
Anil Veeraghattapu 429-Sep-09 21:29 
AnswerRe: detect javascript code for google ad sense Pin
benjymous29-Sep-09 21:50
benjymous29-Sep-09 21:50 
GeneralRe: detect javascript code for google ad sense Pin
Anil Veeraghattapu 429-Sep-09 22:55
Anil Veeraghattapu 429-Sep-09 22:55 
GeneralRe: detect javascript code for google ad sense Pin
benjymous30-Sep-09 1:04
benjymous30-Sep-09 1:04 
QuestionHow to define an inline array of a contstant size in a C# structure Pin
maheesh29-Sep-09 21:13
maheesh29-Sep-09 21:13 
Hi,

How to define an inline array size inside the stucture.Sample code i'm attaching the code block.
I'm using MarshalAs unmanaged it's working fine.
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {    
/// WORD->unsigned short    
public ushort word1;    
/// WORD->unsigned short    
public ushort word2;    
/// BYTE->unsigned char    
public byte byte1;   
 /// BYTE->unsigned char   
 public byte byte2;    
/// BYTE[8]    [
System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=8, ArraySubType=System.Runtime.InteropServices.UnmanagedType.I1)]   
 public byte[] array123;}

And i used a struct which has a create method that fills out the array but it thow an error
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct tPacket {    
public ushort word1;    
public ushort word2;    
public byte byte1;    
public byte byte2;    
public byte[] array123;   
public static tPacket Create() {       
  return new tPacket() { array123 = new byte[8] };    }}


please help me.
With Regards
Mahesh
AnswerRe: How to define an inline array of a contstant size in a C# structure Pin
Luc Pattyn30-Sep-09 0:45
sitebuilderLuc Pattyn30-Sep-09 0:45 
GeneralRe: How to define an inline array of a contstant size in a C# structure Pin
maheesh30-Sep-09 2:42
maheesh30-Sep-09 2:42 
GeneralRe: How to define an inline array of a contstant size in a C# structure Pin
Luc Pattyn30-Sep-09 2:56
sitebuilderLuc Pattyn30-Sep-09 2:56 
GeneralRe: How to define an inline array of a contstant size in a C# structure Pin
maheesh30-Sep-09 3:35
maheesh30-Sep-09 3:35 
GeneralRe: How to define an inline array of a contstant size in a C# structure Pin
Luc Pattyn30-Sep-09 3:49
sitebuilderLuc Pattyn30-Sep-09 3:49 
Questionhow to convert bmp image to hexa conversion ??? Pin
JC.KaNNaN29-Sep-09 21:02
JC.KaNNaN29-Sep-09 21:02 
AnswerRe: how to convert bmp image to hexa conversion ??? Pin
0x3c029-Sep-09 21:15
0x3c029-Sep-09 21:15 
GeneralRe: how to convert bmp image to hexa conversion ??? Pin
JC.KaNNaN29-Sep-09 23:00
JC.KaNNaN29-Sep-09 23:00 
GeneralRe: how to convert bmp image to hexa conversion ??? Pin
0x3c030-Sep-09 5:26
0x3c030-Sep-09 5:26 
QuestionAlter A query In Access using c# Pin
Abdul Rahman Hamidy29-Sep-09 20:43
Abdul Rahman Hamidy29-Sep-09 20:43 
AnswerRe: Alter A query In Access using c# Pin
Abdul Rahman Hamidy30-Sep-09 3:06
Abdul Rahman Hamidy30-Sep-09 3:06 
Questionchange property return type dynamically Pin
$unil Dhiman29-Sep-09 20:12
$unil Dhiman29-Sep-09 20:12 
AnswerRe: change property return type dynamically Pin
Christian Graus29-Sep-09 20:20
protectorChristian Graus29-Sep-09 20:20 
GeneralRe: change property return type dynamically Pin
$unil Dhiman29-Sep-09 20:33
$unil Dhiman29-Sep-09 20:33 
GeneralRe: change property return type dynamically Pin
Christian Graus29-Sep-09 22:12
protectorChristian Graus29-Sep-09 22:12 
Questiondatagrid combobox column Pin
Member 59031029-Sep-09 19:47
Member 59031029-Sep-09 19:47 
AnswerRe: datagrid combobox column Pin
Greg Chelstowski29-Sep-09 21:28
Greg Chelstowski29-Sep-09 21:28 

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.