Click here to Skip to main content
16,008,490 members
Home / Discussions / C#
   

C#

 
GeneralRe: I'm becoming crazy about keys Pin
nitro66618-Aug-02 9:23
nitro66618-Aug-02 9:23 
GeneralRe: I'm becoming crazy about keys Pin
James T. Johnson18-Aug-02 9:24
James T. Johnson18-Aug-02 9:24 
GeneralRe: I'm becoming crazy about keys Pin
leppie19-Aug-02 0:00
leppie19-Aug-02 0:00 
GeneralRe: I'm becoming crazy about keys Pin
James T. Johnson20-Aug-02 5:06
James T. Johnson20-Aug-02 5:06 
GeneralRe: I'm becoming crazy about keys Pin
leppie20-Aug-02 5:25
leppie20-Aug-02 5:25 
GeneralRe: I'm becoming crazy about keys Pin
James T. Johnson20-Aug-02 5:32
James T. Johnson20-Aug-02 5:32 
GeneralRe: I'm becoming crazy about keys Pin
leppie20-Aug-02 5:45
leppie20-Aug-02 5:45 
GeneralRe: I'm becoming crazy about keys Pin
James T. Johnson20-Aug-02 6:02
James T. Johnson20-Aug-02 6:02 
leppie wrote:
According to MSDN an overflow exception will occur unless the block is marked unchecked.

I don't see this case happening, because when the data is being marshalled the framework doesn't know the original context of the value (signed or unsigned it is still a 4-byte block of memory). In this case we are telling it to be interpreted as a signed integer so it should interpret any value with the MSB or LSB set as being negative (assuming 2's complement use of the bits). The only cases where the MSB/LSB is set are when you have values larger than Int32.MaxValue.

There may be some attributes that could be applied to make the framework aware of such occurances, but I'm not aware of them off the top of my head.

Now when you add 2 ints together in managed code the framework does know the context of those values so it can decide whether or not the result went over the max value.



James
"And we are all men; apart from the females." - Colin Davies
GeneralRe: I'm becoming crazy about keys Pin
leppie20-Aug-02 6:11
leppie20-Aug-02 6:11 
GeneralRe: I'm becoming crazy about keys Pin
James T. Johnson20-Aug-02 6:19
James T. Johnson20-Aug-02 6:19 
QuestionAuto Tab? Pin
Johnny Zee16-Aug-02 5:32
sussJohnny Zee16-Aug-02 5:32 
AnswerRe: Auto Tab? Pin
leppie16-Aug-02 6:42
leppie16-Aug-02 6:42 
GeneralTo console or not to console... Pin
Ryan Cromwell16-Aug-02 3:20
Ryan Cromwell16-Aug-02 3:20 
GeneralRe: To console or not to console... Pin
Ryan Cromwell16-Aug-02 4:03
Ryan Cromwell16-Aug-02 4:03 
GeneralResources Pin
leppie16-Aug-02 0:48
leppie16-Aug-02 0:48 
GeneralRe: Resources Pin
Nnamdi Onyeyiri16-Aug-02 0:55
Nnamdi Onyeyiri16-Aug-02 0:55 
GeneralRe: Resources Pin
James T. Johnson16-Aug-02 1:32
James T. Johnson16-Aug-02 1:32 
GeneralRe: Resources Pin
Nnamdi Onyeyiri16-Aug-02 1:49
Nnamdi Onyeyiri16-Aug-02 1:49 
GeneralRe: Resources Pin
James T. Johnson16-Aug-02 1:53
James T. Johnson16-Aug-02 1:53 
GeneralRe: Resources Pin
Nnamdi Onyeyiri16-Aug-02 2:52
Nnamdi Onyeyiri16-Aug-02 2:52 
GeneralRe: Resources Pin
leppie16-Aug-02 1:55
leppie16-Aug-02 1:55 
GeneralRe: Resources Pin
James T. Johnson16-Aug-02 2:14
James T. Johnson16-Aug-02 2:14 
GeneralRe: Resources Pin
leppie16-Aug-02 2:33
leppie16-Aug-02 2:33 
GeneralPainting Order Pin
albean15-Aug-02 20:41
albean15-Aug-02 20:41 
GeneralRe: Painting Order Pin
leppie16-Aug-02 3:09
leppie16-Aug-02 3:09 

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.