GetStdHandle .NET



Hello all,
I ran into trouble with GetStdHandle API. When I'm trying to get standard
output with GetStdHandle(-11I), it returns strange values such as 1548,
1876. If I try to WriteConsole() into these handles, it does not work, and
GetLastError returns ERROR_INVALID_HANDLE. But when I CloseHandle() them, it
succeeds! I tested this in VC++ and VBA, and GetStdHandle(-11) always
returns 7, which is valid. There is the same problem with standard error,
but no problems with standard input.
I declare GetStdHandle as follows:
Declare Function GetStdHandle Lib "kernel32.dll" (ByVal nStdHandle As _
Int32) As IntPtr

Any suggestions? Thank you in advance.





.



Relevant Pages

  • Re: Replacement for MS STL?
    ... ones mandated by the C++ Standard. ... and you got in some trouble ... immediately fell over several bugs in it that took a lot of time to find. ... reading documentation. ...
    (microsoft.public.vc.stl)
  • Re: POR .......... ish.
    ... that we have a Jolly Roger inserted on the fly of the District Flag ... The JR has always been your standard! ... concurr in almost everything - strange, ... Now on the issue of Explorer Scouting operations/structure...... ...
    (uk.rec.scouting)
  • Re: / /home on different partitions?
    ... When you ask people, the anwsers is "I ... me that is strange. ... Standard should be to remove the user. ... The ONLY thing I am talking about is a fixed place for the shared data, ...
    (alt.os.linux.suse)
  • Re: A question of style...
    ... I've got a bunch of classes that take a url for their initialize ... methods, and do a little cleaning on the url, just in case. ... ended up getting longer and longer, and strange and stranger. ... I think it's more standard to use String#dup rather than clone. ...
    (comp.lang.ruby)
  • Re: POR .......... ish.
    ... that we have a Jolly Roger inserted on the fly of the District Flag ... The JR has always been your standard! ... concurr in almost everything - strange, ... Now on the issue of Explorer Scouting operations/structure...... ...
    (uk.rec.scouting)