🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.ms.programmer
1 messages
1 total messages Started by Scott Barman Wed, 29 Jul 1992 20:13
Command line arguments question
#122
Author: Scott Barman
Date: Wed, 29 Jul 1992 20:13
33 lines
1901 bytes
I am far from a Windows expert but I am trying to help a friend out with
a program written for Windows 3.0.  What we are trying to do is access
the command line in a section that is not part of the WinMain()
function.  Yes, we know about that the command line is passed to the
WinMain() function [please excuse me but I do not have the source code
in front of me to refer to and I'm trusting my increasingly failing
memory], but one has to parse this thing and I'm not really in the mood
to write this type of function or re-invent the wheel.  So I RTFM.

Now after RTFM (the MicroSoft books), I found that there are variables
__argc and __argv that seem to echo the "normal" argc and argv that
would be passed to main() if I wasn't dealing with a Windows program.
HOWEVER, in trying to determine the best way to do this, several
"experts" have said to use that "szCmdLine" (or whatever) variable from
the WinMain() call that there is no __argc or __argv.  Personally, I
would rather use the __argc and __argv if they behave like they are
supposed to rather than re-invent the wheel and parse the command line.

So the question is can I define:

	extern int	__argc;
	extern char	**__argv;

and access the command line using those variables?

Please respond via email since my net reading time is at a minimum these
days (just too much to do!).

THANKS!!!!
-- 
scott barman			| <This space intentionally left blank>
scott@asd.com			|
 (I can barely speak for myself, you expect me to speak for my employer??)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads