Click here to Skip to main content
15,910,009 members
Home / Discussions / C#
   

C#

 
AnswerRe: Only able to print once? Pin
LongRange.Shooter11-May-06 6:56
LongRange.Shooter11-May-06 6:56 
GeneralRe: Only able to print once? Pin
melanieab11-May-06 9:15
melanieab11-May-06 9:15 
GeneralRe: Only able to print once? Pin
melanieab12-May-06 6:05
melanieab12-May-06 6:05 
GeneralRe: Only able to print once? Pin
Martin#16-Nov-06 22:57
Martin#16-Nov-06 22:57 
Questionoverrride onpaint Pin
Sasuko11-May-06 4:27
Sasuko11-May-06 4:27 
AnswerRe: overrride onpaint Pin
Ravi Bhavnani11-May-06 4:55
professionalRavi Bhavnani11-May-06 4:55 
AnswerRe: overrride onpaint Pin
leppie11-May-06 7:52
leppie11-May-06 7:52 
QuestionWhy doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 4:07
nicknotyet11-May-06 4:07 
My assembly is compiled for 64-bit, it is calling an unmanaged DLL, also compiled for 64-bit.

The kicker is that "long" compiles to Int64 on my side whereas "long" compiles to Int32 on the unmanaged side (right?)

So if I declare the unmanaged API like this

[DllImport("MyDll.dll", SetLastError = false)]
static extern void FillTheLong
(
out long theLong,
);

And call it like this

long myLong = 0xFFFFFFFF;
long myOtherLong;

FillTheLong(out myLong, out myOtherLong);

I would expect to hose the stack, but nothing adverse happens across hundreds of calls like this. Hard to believe I am just getting lucky, is the runtime protecting me somehow.

Anybody got a pointer to resources on details of P/Invoke and marshaling?

Thanks

NIK




AnswerRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Judah Gabriel Himango11-May-06 5:22
sponsorJudah Gabriel Himango11-May-06 5:22 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 5:54
nicknotyet11-May-06 5:54 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Judah Gabriel Himango11-May-06 5:59
sponsorJudah Gabriel Himango11-May-06 5:59 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
led mike11-May-06 6:21
led mike11-May-06 6:21 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet11-May-06 11:44
nicknotyet11-May-06 11:44 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
Matt Newman11-May-06 19:26
Matt Newman11-May-06 19:26 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet12-May-06 3:37
nicknotyet12-May-06 3:37 
AnswerRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
leppie11-May-06 22:13
leppie11-May-06 22:13 
GeneralRe: Why doesn't my code crash? Passing Int64 to Int32 Pin
nicknotyet12-May-06 3:42
nicknotyet12-May-06 3:42 
QuestionGrid Control recommendations Pin
Aaron Schaefer11-May-06 4:03
Aaron Schaefer11-May-06 4:03 
AnswerRe: Grid Control recommendations Pin
KrIstOfK11-May-06 4:19
KrIstOfK11-May-06 4:19 
GeneralRe: Grid Control recommendations Pin
Aaron Schaefer11-May-06 5:14
Aaron Schaefer11-May-06 5:14 
GeneralRe: Grid Control recommendations Pin
KrIstOfK11-May-06 10:41
KrIstOfK11-May-06 10:41 
GeneralRe: Grid Control recommendations Pin
Robert Rohde11-May-06 10:43
Robert Rohde11-May-06 10:43 
GeneralRe: Grid Control recommendations Pin
Aaron Schaefer11-May-06 10:46
Aaron Schaefer11-May-06 10:46 
Questiona few questions about forms ??? Pin
cmpeng3411-May-06 4:00
cmpeng3411-May-06 4:00 
AnswerRe: a few questions about forms ??? Pin
NaNg1524111-May-06 8:04
NaNg1524111-May-06 8: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.