Click here to Skip to main content
15,889,609 members
Home / Discussions / C#
   

C#

 
GeneralRe: binding the data to the grid Pin
That's Aragon5-Feb-08 18:29
That's Aragon5-Feb-08 18:29 
GeneralRe: binding the data to the grid Pin
chithra.r5-Feb-08 21:33
chithra.r5-Feb-08 21:33 
GeneralRe: binding the data to the grid Pin
chithra.r5-Feb-08 21:35
chithra.r5-Feb-08 21:35 
GeneralRe: binding the data to the grid Pin
That's Aragon5-Feb-08 22:05
That's Aragon5-Feb-08 22:05 
GeneralDeploying my C# control internationally : Sattelite Assembly Support Pin
Nadia Monalisa5-Feb-08 16:46
Nadia Monalisa5-Feb-08 16:46 
GeneralExit In XNA Pin
MasterSharp5-Feb-08 14:46
MasterSharp5-Feb-08 14:46 
GeneralRe: Exit In XNA Pin
Ennis Ray Lynch, Jr.5-Feb-08 17:13
Ennis Ray Lynch, Jr.5-Feb-08 17:13 
GeneralCreating a structure that returns a value for sizeof() Pin
Skippums5-Feb-08 12:32
Skippums5-Feb-08 12:32 
I am attempting to create a structure that I would like to call sizeof(myStruct) to return 16. However, when I attempt to make this call from code, I get the error,
'myStruct' does not have a predefined size, therefore sizeof can only be used
in an unsafe context (consider using System.Runtime.InteropServices.Marshal.SizeOf)
I searched online, and the only note that I found was someone who stated that, because the CLR determines the layout of the structure at runtime, the size of myStruct cannot be determined at compile time. Due to this comment, I thought that I could include the following attribute on my structure to solve this problem:
// Try to align on an 8-byte boundry, with the struct actually having size 16 bytes
[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 16)]
public struct myStruct : IEquatable<myStruct>, IComparable<myStruct>, IComparable {
    ...
}
However, this results in the same error. There has to be a way for me to do this, as the built-in types int, float, etc. all allow this method call without throwing an exception. Another issue that I think is related is that I cannot declare a constant of type myStruct. If anyone has some insight into either of these problems, I would appreciate some help. Thanks,

Sounds like somebody's got a case of the Mondays

-Jeff

GeneralRe: Creating a structure that returns a value for sizeof() Pin
PIEBALDconsult5-Feb-08 13:32
mvePIEBALDconsult5-Feb-08 13:32 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
Skippums5-Feb-08 13:38
Skippums5-Feb-08 13:38 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
Mark Churchill5-Feb-08 14:28
Mark Churchill5-Feb-08 14:28 
QuestionRe: Creating a structure that returns a value for sizeof() Pin
Skippums6-Feb-08 4:55
Skippums6-Feb-08 4:55 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
PIEBALDconsult6-Feb-08 13:06
mvePIEBALDconsult6-Feb-08 13:06 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
Skippums6-Feb-08 13:36
Skippums6-Feb-08 13:36 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
Mark Churchill6-Feb-08 15:16
Mark Churchill6-Feb-08 15:16 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
PIEBALDconsult5-Feb-08 14:28
mvePIEBALDconsult5-Feb-08 14:28 
GeneralRe: Creating a structure that returns a value for sizeof() Pin
Skippums6-Feb-08 4:59
Skippums6-Feb-08 4:59 
GeneralI need help how to start this program. Pin
Alex5015-Feb-08 11:27
Alex5015-Feb-08 11:27 
GeneralRe: I need help how to start this program. Pin
Gareth H5-Feb-08 11:59
Gareth H5-Feb-08 11:59 
GeneralRe: I need help how to start this program. Pin
led mike5-Feb-08 12:07
led mike5-Feb-08 12:07 
GeneralRe: I need help how to start this program. Pin
Malcolm Smart5-Feb-08 21:05
Malcolm Smart5-Feb-08 21:05 
GeneralRe: I need help how to start this program. Pin
J4amieC5-Feb-08 22:37
J4amieC5-Feb-08 22:37 
GeneralRe: I need help how to start this program. Pin
Wes Aday6-Feb-08 4:18
professionalWes Aday6-Feb-08 4:18 
GeneralBest method to save dynamic data Pin
Richard Blythe5-Feb-08 10:50
Richard Blythe5-Feb-08 10:50 
GeneralRe: Best method to save dynamic data Pin
led mike5-Feb-08 12:04
led mike5-Feb-08 12:04 

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.