It is currently Thu Feb 09, 2012 12:20 am

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 3 posts ] 
Author Message
 Post subject: Accessing command line arguments
PostPosted: Tue Jul 14, 2009 9:49 am 

Joined: Tue Jul 14, 2009 9:21 am
Posts: 22
Location: Germany
Hi,

my application has a main class, let's say MainController. By main class I mean the (only) one that I checked in the initialization tab for my component's configuration. Now the MainController needs access to the command line arguments. My first idea was to pass these via the constructor. But then I found it impossible to tell Rhapsody to pass argc and argv to my MainController's constructor. It seems that such main classes can only be instantiated via default constructor by Rhapsody (please correct me in case I'm wrong). But then, what is the best way to pass argc and argv to my MainController instance?

Thanks,
Christian


Offline
 Profile  
 
 Post subject: Optimism
PostPosted: Tue Jul 14, 2009 12:52 pm 

Joined: Wed May 07, 2008 3:50 pm
Posts: 148
Location: Horsham, W Sussex, England
Don't worry, I reckon you'll be able to do it once you've viewed your (real) main file. Under your Component and Configuration can be found hyperlinks to the main file and the makefile. If you double-click on the "Edit Main File" and then swap over to the cpp rather than the header by using the tabs at the bottom of the Rhapsody window - it should become clearer. The arguments are already being used by Rhapsody, so I guess there is nothing to stop you also using them also.

Then because the (real) main file is autogenerated you probably want to read the User Manual section entitled, "Making permanent changes to the main file".

Good luck.


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Jul 15, 2009 8:17 am 

Joined: Tue Jul 14, 2009 9:21 am
Posts: 22
Location: Germany
Hi Shanz,

thanks for the pointer. The User Manual was not that clear, but after some fiddling with some properties and combinations I finally got it working. What I did now is to write the whole main() on my own by
  • Adding a File of type Implementation to my Component containing a single text element with my main() (and supporting includes)
  • In the configuration, changed the property GG::Configuration::MainGenerationScheme from Full to None


Christian


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

cron

suspicion-preferred