Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Implementing argc and argv in a non-PhAB Photon application
Ref. No. QNX.000005792
Category(ies) Development
Issue I would like to use the same parameters on the command line, similiar to the applications that are built with PhAB. For instance, if I pass a -s <server name> or dimensions on the command line, I want my program to use them.
Solution To attach your program to a specific server, you will have to use the PhAttach() function to handle the -s parameter.  If you detect a dimension on the command line (perhaps using the getopts() function), you can simply use PtSetArg() and PtSetResources() on your base window to set the position and dimension. (Pt_ARG_DIM, Pt_ARG_POS)