Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
GeneralRe: Typed Datasets Pin
cdpace25-Aug-09 11:28
cdpace25-Aug-09 11:28 
GeneralRe: Typed Datasets Pin
Henry Minute25-Aug-09 12:07
Henry Minute25-Aug-09 12:07 
GeneralRe: Typed Datasets Pin
cdpace25-Aug-09 20:37
cdpace25-Aug-09 20:37 
QuestionHow to have a "Loading..." Form Pin
shultas25-Aug-09 5:57
shultas25-Aug-09 5:57 
AnswerRe: How to have a "Loading..." Form Pin
DaveyM6925-Aug-09 6:22
professionalDaveyM6925-Aug-09 6:22 
QuestionHow to rebuild a struct from bytes after transfer [C#] Pin
Shaitan0025-Aug-09 4:46
Shaitan0025-Aug-09 4:46 
AnswerRe: How to rebuild a struct from bytes after transfer [C#] Pin
stancrm25-Aug-09 5:20
stancrm25-Aug-09 5:20 
AnswerRe: How to rebuild a struct from bytes after transfer [C#] Pin
DaveyM6925-Aug-09 7:24
professionalDaveyM6925-Aug-09 7:24 
I think the easiest way to do this is to replicate the struct on the C# end so you can pass the data using ref or out (or if it's a pointer that you get - Marshal.PtrToStructure) without needing to use the byte array.

You will have problems using both char[] and string when using C# as they are not the same as in C++.

char[] is really an array of bytes. The string may need to have a MAXSIZE constant. So, you may need something like this:
public static class Constants
{
    public const int MAXPARAMETERENGTH = 1024;
    public const int SIZEOFCOMMAND = 8;
}
[StructLayout(LayoutKind.Sequential)]
public struct MESSAGE
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.SIZEOFCOMMAND, ArraySubType = UnmanagedType.U1)]
    public byte[] cCommand;
    [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = Constants.MAXPARAMETERENGTH)]
    public string sParameter;
}
I'm not happy with passing the command as a byte array - I've never had to deal with a char[] like this before.

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

QuestionCompile errors in Release mode while there are no errors in Debug mode Pin
NarVish25-Aug-09 4:38
NarVish25-Aug-09 4:38 
AnswerRe: Compile errors in Release mode while there are no errors in Debug mode Pin
Hristo-Bojilov25-Aug-09 7:07
Hristo-Bojilov25-Aug-09 7:07 
QuestionThe stream does not support concurrent I/O read or write operations Pin
mbyamukama25-Aug-09 3:38
mbyamukama25-Aug-09 3:38 
AnswerRe: The stream does not support concurrent I/O read or write operations Pin
riced25-Aug-09 6:51
riced25-Aug-09 6:51 
Question[Message Deleted] Pin
ankitjain111025-Aug-09 2:56
ankitjain111025-Aug-09 2:56 
AnswerRe: how to dispaly some specific values from databse into datagrid view...am using microsoft access Pin
Henry Minute25-Aug-09 3:01
Henry Minute25-Aug-09 3:01 
AnswerRe: how to dispaly some specific values from databse into datagrid view...am using microsoft access Pin
Vasudevan Deepak Kumar25-Aug-09 3:03
Vasudevan Deepak Kumar25-Aug-09 3:03 
AnswerRe: how to dispaly some specific values from databse into datagrid view...am using microsoft access Pin
Keith Barrow25-Aug-09 3:05
professionalKeith Barrow25-Aug-09 3:05 
AnswerRe: how to dispaly some specific values from databse into datagrid view...am using microsoft access Pin
Blue_Boy25-Aug-09 3:06
Blue_Boy25-Aug-09 3:06 
AnswerRe: how to dispaly some specific values from databse into datagrid view...am using microsoft access Pin
ankitjain111025-Aug-09 3:20
ankitjain111025-Aug-09 3:20 
QuestionC# FTP Site Creation on IIs 5.1 ( System.DirectoryServices) Pin
MikeSharp25-Aug-09 2:44
MikeSharp25-Aug-09 2:44 
AnswerRe: C# FTP Site Creation on IIs 5.1 ( System.DirectoryServices) Pin
Vasudevan Deepak Kumar25-Aug-09 3:12
Vasudevan Deepak Kumar25-Aug-09 3:12 
GeneralRe: C# FTP Site Creation on IIs 5.1 ( System.DirectoryServices) Pin
MikeSharp25-Aug-09 6:39
MikeSharp25-Aug-09 6:39 
QuestionCustomizing a Windows Form Pin
Etienne_12325-Aug-09 2:24
Etienne_12325-Aug-09 2:24 
AnswerRe: Customizing a Windows Form Pin
pelnor25-Aug-09 3:44
pelnor25-Aug-09 3:44 
Questiondata gridview error Pin
myinstincts25-Aug-09 1:26
myinstincts25-Aug-09 1:26 
AnswerRe: data gridview error Pin
padmanabhan N25-Aug-09 1:53
padmanabhan N25-Aug-09 1:53 

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.