Click here to Skip to main content
15,905,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to add multiple controls at runTime ? Pin
hdv21222-Feb-09 1:30
hdv21222-Feb-09 1:30 
GeneralRe: How to add multiple controls at runTime ? Pin
dan!sh 22-Feb-09 1:52
professional dan!sh 22-Feb-09 1:52 
GeneralRe: How to add multiple controls at runTime ? Pin
ABitSmart22-Feb-09 2:09
ABitSmart22-Feb-09 2:09 
AnswerRe: How to add multiple controls at runTime ? Pin
Luc Pattyn22-Feb-09 2:27
sitebuilderLuc Pattyn22-Feb-09 2:27 
QuestionCompile error: Using strings inside Struct with LayoutKind.Explicit Pin
Member 349379921-Feb-09 23:57
Member 349379921-Feb-09 23:57 
AnswerRe: Compile error: Using strings inside Struct with LayoutKind.Explicit Pin
Luc Pattyn22-Feb-09 2:35
sitebuilderLuc Pattyn22-Feb-09 2:35 
GeneralRe: Compile error: Using strings inside Struct with LayoutKind.Explicit Pin
Member 349379922-Feb-09 3:04
Member 349379922-Feb-09 3:04 
GeneralRe: Compile error: Using strings inside Struct with LayoutKind.Explicit Pin
Member 349379922-Feb-09 3:08
Member 349379922-Feb-09 3:08 
Just a note for anyone else who comes across this issue and sees this thread:

The solution provided by Luc does NOT WORK with LayoutKind.Explicit, it only works with LayoutKind.Sequential, and with the FieldOffset()'s removed (obviously).

This is the compiling + working code:

[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 66, CharSet = CharSet.Ansi)]
                public struct chatOne
                {

                    public int packetType; //4
                    public int packetNumber; //4
                    public int packetSource; //4
                    public int packetDestination; //4
                    public short packetPort; // 2
                    public ushort packetInfoEnd; // 2
                    public byte dataId; // 1
                    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)]
                    public string dataSender; // 11
                    public byte dataPadOne; // 1
                    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 23)]
                    public string dataMessage; // 23
                    public short dataPart; // 2
                    public int dataEndCodeOne; // 4
                    public int dataEndCodeTwo; // 4

                    public chatOne(int dst, short port, string sender, string message)
                    {
                        packetType = 1192961;
                        packetNumber = 0;
                        packetSource = 0;
                        packetDestination = dst;
                        packetPort = IPAddress.HostToNetworkOrder(port);
                        packetInfoEnd = 43521;                      
                        dataId = 10;
                        dataSender = sender;
                        dataPadOne = 0;
                        dataMessage = message;
                        dataPart = 206;
                        dataEndCodeOne = 10209786;
                        dataEndCodeTwo = 6658;
                    }
                }

QuestionHow do I persist cookies between multiple HttpWebRequest sessions? Pin
god.hacks21-Feb-09 23:20
god.hacks21-Feb-09 23:20 
AnswerCan anybody help me at all? Pin
god.hacks22-Feb-09 2:57
god.hacks22-Feb-09 2:57 
QuestionClose window by itself Pin
dabuskol21-Feb-09 21:20
dabuskol21-Feb-09 21:20 
AnswerRe: Close window by itself Pin
Luis Alonso Ramos21-Feb-09 22:38
Luis Alonso Ramos21-Feb-09 22:38 
AnswerRe: Close window by itself Pin
Megidolaon23-Feb-09 3:50
Megidolaon23-Feb-09 3:50 
Questiondisplaying database query result in reports Pin
Mubeen.asim21-Feb-09 19:35
Mubeen.asim21-Feb-09 19:35 
AnswerRe: displaying database query result in reports Pin
Wendelius21-Feb-09 20:45
mentorWendelius21-Feb-09 20:45 
GeneralRe: displaying database query result in reports Pin
Mubeen.asim22-Feb-09 2:16
Mubeen.asim22-Feb-09 2:16 
Questionplaying mpeg file Pin
sbs21-Feb-09 17:56
sbs21-Feb-09 17:56 
Question[Message Deleted] Pin
Mel Feik21-Feb-09 17:36
Mel Feik21-Feb-09 17:36 
AnswerRe: creating a service with monitoring capabilities... Pin
Mubeen.asim22-Feb-09 2:22
Mubeen.asim22-Feb-09 2:22 
Question[Message Deleted] Pin
rpopple21-Feb-09 14:12
rpopple21-Feb-09 14:12 
AnswerRe: child handle in a window programed in a different language Pin
Anthony Mushrow21-Feb-09 15:37
professionalAnthony Mushrow21-Feb-09 15:37 
GeneralRe: child handle in a window programed in a different language Pin
rpopple22-Feb-09 4:58
rpopple22-Feb-09 4:58 
Questionproc.MainWindowTitle == variable doesn't work Pin
Kimjor21-Feb-09 10:54
Kimjor21-Feb-09 10:54 
AnswerRe: proc.MainWindowTitle == variable doesn't work Pin
Christian Graus21-Feb-09 11:25
protectorChristian Graus21-Feb-09 11:25 
AnswerRe: proc.MainWindowTitle == variable doesn't work Pin
Xmen Real 22-Feb-09 3:15
professional Xmen Real 22-Feb-09 3:15 

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.