Click here to Skip to main content
15,907,396 members
Home / Discussions / C#
   

C#

 
AnswerRe: Incorrect syntax near the keyword 'Transaction' Pin
Mike Ellison23-Jul-09 18:09
Mike Ellison23-Jul-09 18:09 
QuestionFile Tansfer Protocols in VC# Pin
bigjoe11a23-Jul-09 16:50
bigjoe11a23-Jul-09 16:50 
QuestionHow do you store a bunch of values in a 20x20 array Pin
Nathan Revka23-Jul-09 15:20
Nathan Revka23-Jul-09 15:20 
AnswerRe: How do you store a bunch of values in a 20x20 array Pin
PIEBALDconsult23-Jul-09 15:34
mvePIEBALDconsult23-Jul-09 15:34 
GeneralRe: How do you store a bunch of values in a 20x20 array Pin
Nathan Revka23-Jul-09 17:06
Nathan Revka23-Jul-09 17:06 
AnswerRe: How do you store a bunch of values in a 20x20 array Pin
musefan23-Jul-09 22:08
musefan23-Jul-09 22:08 
AnswerRe: How do you store a bunch of values in a 20x20 array Pin
RugbyLeague23-Jul-09 23:11
RugbyLeague23-Jul-09 23:11 
Question[MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Don Marino23-Jul-09 10:35
Don Marino23-Jul-09 10:35 
I'm having an issue determining the size of an array of structures, missingTrans in the code below, that reside within another structure, REGISTER_TOTALS. When I use the MarshalAs attribute shown in the code it sees missingTrans as a 4 byte reference to the array. When I do a, Marshal.SizeOf(typeof(MISSING_TRANS)), the result is that missingTrans is calculated as being 24 bytes instead of 48. I've tried google and searched numerous message boards but have been unable to come up with anything that works. I would appreciate any help.

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class MISSING_TRANS
{
    public UInt32 FirstTrans;
    public UInt32 LastTrans;

    public void byteSwap()
    {
        ISPData.swap4Bytes(ref FirstTrans);
        ISPData.swap4Bytes(ref LastTrans);
    } // end byteSwap()
} // end class MISSING_TRANS


[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class REGISTER_TOTALS
{
    public RECORD_ID recID;  // 8
    public UInt16 RecordVersion;
    public UInt16 LocationNum;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 52)]
    public byte[] Filler1;
    public UInt32 RegRdsTotal;           // 08.08
    public UInt32 CalcRdsTotal;          // 08.08
    public UInt16 RegRdsCount;           // 08.08
    public UInt16 CalcRdsCount;          // 08.08

    ...
    [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct,
               SizeConst = 6)]
    public MISSING_TRANS[] missingTrans;
    public UInt16 RegisterForceClosed;
    public UInt16 RegisterModel;

    ...
} //end class REGISTER_TOTALS

AnswerRe: [MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Luc Pattyn23-Jul-09 12:04
sitebuilderLuc Pattyn23-Jul-09 12:04 
GeneralRe: [MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Don Marino24-Jul-09 1:27
Don Marino24-Jul-09 1:27 
GeneralRe: [MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Luc Pattyn24-Jul-09 1:37
sitebuilderLuc Pattyn24-Jul-09 1:37 
GeneralRe: [MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Don Marino24-Jul-09 3:32
Don Marino24-Jul-09 3:32 
GeneralRe: [MarshalAs()] attribute and Marshal.SizeOf() Issue Pin
Luc Pattyn24-Jul-09 12:41
sitebuilderLuc Pattyn24-Jul-09 12:41 
QuestionWhy do I get a "Cross thread" Exception? Pin
David8001C23-Jul-09 8:32
David8001C23-Jul-09 8:32 
AnswerRe: Why do I get a "Cross thread" Exception? Pin
Luc Pattyn23-Jul-09 8:41
sitebuilderLuc Pattyn23-Jul-09 8:41 
GeneralRe: Why do I get a "Cross thread" Exception? Pin
David8001C23-Jul-09 8:49
David8001C23-Jul-09 8:49 
GeneralRe: Why do I get a "Cross thread" Exception? Pin
Luc Pattyn23-Jul-09 9:03
sitebuilderLuc Pattyn23-Jul-09 9:03 
GeneralRe: Why do I get a "Cross thread" Exception? Pin
David8001C23-Jul-09 9:11
David8001C23-Jul-09 9:11 
GeneralRe: Why do I get a "Cross thread" Exception? Pin
Luc Pattyn23-Jul-09 9:21
sitebuilderLuc Pattyn23-Jul-09 9:21 
GeneralRe: Why do I get a "Cross thread" Exception? Pin
Luc Pattyn23-Jul-09 13:12
sitebuilderLuc Pattyn23-Jul-09 13:12 
AnswerRe: Why do I get a "Cross thread" Exception? Pin
PIEBALDconsult23-Jul-09 8:42
mvePIEBALDconsult23-Jul-09 8:42 
QuestionHow to copy assembly from GAC to local drive ? Pin
hdv21223-Jul-09 8:06
hdv21223-Jul-09 8:06 
AnswerRe: How to copy assembly from GAC to local drive ? Pin
Ian McCaul23-Jul-09 8:20
Ian McCaul23-Jul-09 8:20 
AnswerRe: How to copy assembly from GAC to local drive ? Pin
stancrm23-Jul-09 9:17
stancrm23-Jul-09 9:17 
AnswerRe: How to copy assembly from GAC to local drive ? Pin
Abhijit Jana23-Jul-09 10:13
professionalAbhijit Jana23-Jul-09 10:13 

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.