Click here to Skip to main content
15,917,862 members
Home / Discussions / C#
   

C#

 
GeneralRe: Declaring and Passing value to public variable Pin
Vikram A Punathambekar5-Feb-08 19:37
Vikram A Punathambekar5-Feb-08 19:37 
GeneralRe: Declaring and Passing value to public variable Pin
klaydze7-Feb-08 14:16
klaydze7-Feb-08 14:16 
GeneralRe: Declaring and Passing value to public variable Pin
Vikram A Punathambekar8-Feb-08 1:53
Vikram A Punathambekar8-Feb-08 1:53 
Generalopen Microsoft Access from c# Pin
tonato8485-Feb-08 17:41
tonato8485-Feb-08 17:41 
GeneralRe: open Microsoft Access from c# Pin
Adeel Chaudhry5-Feb-08 18:37
Adeel Chaudhry5-Feb-08 18:37 
Generalbinding the data to the grid Pin
chithra.r5-Feb-08 17:12
chithra.r5-Feb-08 17:12 
GeneralRe: binding the data to the grid Pin
That's Aragon5-Feb-08 17:59
That's Aragon5-Feb-08 17:59 
GeneralRe: binding the data to the grid Pin
chithra.r5-Feb-08 18:10
chithra.r5-Feb-08 18:10 
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 

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.