S
Shawn B.
Greetings,
Me again.
I have (roughly) the following code:
HANDLE hConsoleOutput;
HANDLE hConsoleInput;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
hConsoleInput = GetStdHandle(STD_INPUT_HANDLE);
after executing, each of the hConsole* variables contain 'void'. Yet, if I
declare them as IntPtr instead, they each contain a proper number. The
problem is, immediately after I call:
GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleInfo);
And one of two things happens:
1) If hConsole* variables declared as HANDLE, then I get a first-chance
exception.
2) If hConsole* variables declared as IntPtr, I get a
'GetConsoleScreenBufferInfo' : cannot convert parameter 1 from
'System::IntPtr __gc *' to 'HANDLE'
compile error.
(laughing out loud) I thought "it just works".
Anyway, how can I coerce an IntPtr into a HANDLE pararameter on an API
function? Once again, Google hasn't provided any obvious answers.
Thanks,
Shawn
Me again.
I have (roughly) the following code:
HANDLE hConsoleOutput;
HANDLE hConsoleInput;
hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
hConsoleInput = GetStdHandle(STD_INPUT_HANDLE);
after executing, each of the hConsole* variables contain 'void'. Yet, if I
declare them as IntPtr instead, they each contain a proper number. The
problem is, immediately after I call:
GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleInfo);
And one of two things happens:
1) If hConsole* variables declared as HANDLE, then I get a first-chance
exception.
2) If hConsole* variables declared as IntPtr, I get a
'GetConsoleScreenBufferInfo' : cannot convert parameter 1 from
'System::IntPtr __gc *' to 'HANDLE'
compile error.
(laughing out loud) I thought "it just works".
Anyway, how can I coerce an IntPtr into a HANDLE pararameter on an API
function? Once again, Google hasn't provided any obvious answers.
Thanks,
Shawn