Click here to Skip to main content
15,888,031 members
Home / Discussions / C#
   

C#

 
Questionwindows that don't receive focus?? Pin
jremignanti8-Jun-04 5:32
jremignanti8-Jun-04 5:32 
AnswerRe: windows that don't receive focus?? Pin
Heath Stewart8-Jun-04 6:06
protectorHeath Stewart8-Jun-04 6:06 
Questionasp.net script timeout? Pin
lelelele8-Jun-04 5:13
lelelele8-Jun-04 5:13 
AnswerRe: asp.net script timeout? Pin
Heath Stewart8-Jun-04 6:00
protectorHeath Stewart8-Jun-04 6:00 
GeneralCopy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 5:05
dgiljr8-Jun-04 5:05 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 5:53
protectorHeath Stewart8-Jun-04 5:53 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 6:24
dgiljr8-Jun-04 6:24 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 6:31
protectorHeath Stewart8-Jun-04 6:31 
Again, this is still a simple parsing problem. Do read about the UnmanagedType.ByValTStr, though. Using that in your MarshalAsAttribute for fields and setting the SizeConst field means you don't even have to change the offsets - another reason to use LayoutKind.Sequential.

This still doesn't make a whole lot of sense, though. How is it easier to pass a string as a struct? Just encode the string and pass the byte[] array, since a byte[] is always the same on any platform (not taking into account endianess). Just make sure you use the same encoding on both ends. The HTTP protocol, for example, specifies the encoding in the HTTP headers.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 7:01
dgiljr8-Jun-04 7:01 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
Heath Stewart8-Jun-04 8:17
protectorHeath Stewart8-Jun-04 8:17 
GeneralRe: Copy A Fixed String Buffer Into A Struct Pin
dgiljr8-Jun-04 10:32
dgiljr8-Jun-04 10:32 
Generaltextbox control with multi colored rows Pin
gmahesh8-Jun-04 2:05
gmahesh8-Jun-04 2:05 
GeneralRe: textbox control with multi colored rows Pin
Aryadip8-Jun-04 2:48
Aryadip8-Jun-04 2:48 
GeneralRe: textbox control with multi colored rows Pin
gmahesh8-Jun-04 2:57
gmahesh8-Jun-04 2:57 
GeneralRe: textbox control with multi colored rows Pin
Aaron Eldreth8-Jun-04 3:47
Aaron Eldreth8-Jun-04 3:47 
GeneralRe: textbox control with multi colored rows Pin
gmahesh9-Jun-04 0:58
gmahesh9-Jun-04 0:58 
QuestionLoad file into string? Pin
Dominik Reichl8-Jun-04 1:43
Dominik Reichl8-Jun-04 1:43 
AnswerRe: Load file into string? Pin
Werdna8-Jun-04 3:27
Werdna8-Jun-04 3:27 
GeneralRe: Load file into string? Pin
Dominik Reichl8-Jun-04 4:14
Dominik Reichl8-Jun-04 4:14 
AnswerRe: Load file into string? Pin
Heath Stewart8-Jun-04 4:00
protectorHeath Stewart8-Jun-04 4:00 
GeneralRe: Load file into string? Pin
Dominik Reichl8-Jun-04 4:19
Dominik Reichl8-Jun-04 4:19 
GeneralRe: Load file into string? Pin
Heath Stewart8-Jun-04 4:22
protectorHeath Stewart8-Jun-04 4:22 
GeneralRe: Draw Shape To Screen Pin
SJ_Phoenix8-Jun-04 0:24
SJ_Phoenix8-Jun-04 0:24 
GeneralRe: Draw Shape To Screen [EDITED] Pin
Dave Kreskowiak8-Jun-04 3:17
mveDave Kreskowiak8-Jun-04 3:17 
GeneralConverting an array list to double array Pin
_Searcher_8-Jun-04 0:01
_Searcher_8-Jun-04 0:01 

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.