[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3211.0. "argc and argv in XtInitialize()" by HGOVC::ALFREDLEUNG () Wed Aug 15 1990 06:01

    According to the manual, the last two arguments of the XtInitialize()
    allow to put in the name of an appication program such that it will be
    executed by the XtInitialize() service, but I try then find that there
    is nothing produced, even no error is generated, it seems that these
    arguments is ignored completely.
    
    Any persons used these two arguments before please give me any idea.
    
    
    Thank.
T.RTitleUserPersonal
Name
DateLines
3211.1QUARK::LIONELFree advice is worth every centWed Aug 15 1990 11:168
As far as I know, the purpose of these arguments is to pass the command line
arguments vector and count as passed to the C main program, and it looks
for certain configuration information there.  From other languages, you pass
a variable zero for ARGC (not a constant) and an empty array for ARGV.

What did you read that made you think it was a program name?

			Steve
3211.2resource managerVINO::MCARLETONReality; what a concept!Wed Aug 15 1990 15:1813
    
    In UN*X argv[0] points to the name of the program that was run.  If
    the command line was:
    
    $foo -l -r -q
    
      then *argv[0] = "foo".  
    
    This argument is used by the X windows resource manager to get the name
    of the program's resource file. In this case the resource manager would
    look for the file DECW$USER_DEFAULTS:FOO.DAT.
    
    						MJC
3211.3ABYSS::dikeWed Aug 15 1990 16:567
.2:
	argv[0] = "foo", *argv[0] = 'f'

argv is a char **, so chasing the pointer once gets you the first argument
(a string) and chasing it twice gets you the first character of the first
argument.
				Jeff
3211.4QUARK::LIONELFree advice is worth every centThu Aug 16 1990 11:194
Of course, it's a major flaw in the X API that this C/Unix-ism is there at
all.  But what else is new?

				Steve