Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General / July 2005



Tip: Looking for answers? Try searching our database.

STD_INPUT_HANDLE -- what is that?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
YYZ - 29 Jul 2005 19:48 GMT
I have been using some code to write CGI programs for a LONG time, and
every once in a while I take another look at it to see if I can really
understand what is going on.  Well, I honestly think that I am about
99% there, but I have one final thing that I can't figure out.

Private Const STD_INPUT_HANDLE = -10&

This is declared, along with STD_OUTPUT_HANDLE = -11& and FILE_BEGINE =
0&

Are these just magic constants?  I searched for STD_INPUT_HANDLE and I
see that it is also used in console applications...is this just some
well-known to everyone but me constant and behavior that every program
always has some information passed to it, and the way to get at that
information is by reading from this file handle.  Am I way offbase?

So, could I use this instead of using command$ (not that I'd want to,
but just wondering).

No huge deal, but I was just wondering if anyone out there had the
answer offhand.

Thanks!

Matt
Ralph - 30 Jul 2005 02:51 GMT
> I have been using some code to write CGI programs for a LONG time, and
> every once in a while I take another look at it to see if I can really
[quoted text clipped - 21 lines]
>
> Matt

Not sure what the question is, but yes they are just magic numbers. They are
used by Windows Console applications to obtain 'handles' for various devices
from the O/S using the Win32 API for High Level Console I/O.

If all your application is doing is processing 'command line parameters'
then using Command$ is probably all that is necessary.

hth
-ralph
YYZ - 30 Jul 2005 17:50 GMT
> Not sure what the question is, but yes they are just magic numbers.
> They are used by Windows Console applications to obtain
[quoted text clipped - 3 lines]
> If all your application is doing is processing 'command line parameters'
> then using Command$ is probably all that is necessary.

Thanks for that -- I remember having the same problem with connection
strings when I first started -- I just couldn't believe that to connect
to Access you had to type in some exact string -- I unerstand why now,
but it threw me many years ago.

As for command$ -- yes, I do use command$ -- but now I think I
understand a bit more about how command$ works behind the scenes.  In
my case, the code I was talking about was a CGI application, and I got
it off the net years ago.  Now I want to test it to see if I can just
get the POST form data from using Command$ instead of reading in from
STD_INPUT_HANDLE -- not because I want to change it, but just so I can
understand it better.

Thanks for the information.

Matt
Ralph - 30 Jul 2005 22:13 GMT
> > Not sure what the question is, but yes they are just magic numbers.
> > They are used by Windows Console applications to obtain
[quoted text clipped - 20 lines]
>
> Matt

You might want to check out the following borish information:
http://msdn.microsoft.com/library/en-us/dllproc/base/consoles.asp?

Win32 Console applications are often confused with 'Dos' applications. It
never helped that MS continued to call opening a 'cmd' window a "DOS
Prompt".

[Aside note: you can open a 16-bit 'command' window by typing Run: command.
Typing 'cmd' opens a 32-bit Console.]

Win32 Console applications write their std_in, std_out, and std_err to their
own Console window. (Thats why you were retrieving handles.) One Console's
std_out, may not be the std_in for another application, ie, CGI may not work
as expected.

Here is a useful site:
http://vb.mvps.org/samples/project.asp?id=console

hth
-ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.