Path: utzoo!attcan!uunet!mcsun!unido!zgdvda!dingelde From: dingelde@zgdvda.zgdvda.uucp (Dennis Dingeldein) Newsgroups: comp.lang.c++ Subject: Access to argc,argv outside main() ? Message-ID: <3101@zgdvda.zgdvda.uucp> Date: 24 Oct 90 10:23:11 GMT Organization: ZGDV Darmstadt, FRG Lines: 37 Hello! I have the following problem with my favourite language :-) : Short: My objects need to access argc and argv coming from the command line. Those values are undefined outside main. So, global defined objects can`t access these values (Right?) . Can I access argv, argc outside main (before entering main()) ??? How ??? These objects are part of a User Interface Toolkit, so I won`t restrict the end user to dynamical objects or only objects inside of main, if possible (He/She would not understand that). Long: I am writing objects, whose constructors creates Widgets from Motif. When creating widgets, I like to use the resources for those widgets. These resources can be given on the command line. So far, so good. My objects can be defined global, that means outside main(). But there, I can not access the command line arguments. This means that I can`t use command line given resources. I can`t even give them to XtInitialize() (this function must be called before creating widgets, I guess), so not even the fundamental resources (for example "-display" or "-background") can be set. Did anyone else had - even better solved - this problem ? I guess that problem is not bounded to X Applications but to all applications, where objects try to access the command arguments. PS: excuse my english... -- Dennis Dingeldein ZGDV Zentrum fuer Graphische Datenverarbeitung (dingelde@zgdvda.uucp) Wilhelminenstr. 7 wMw D-6100 Darmstadt, West Germany ~.~ Phone: +49/6151/155-101 \-/