The ICurrentApplication class represents the program that is currently running. You are limited to a single object of this class. To obtain a reference to the object, use the static function IApplication::current. The object of this class contains information that the Open Class Library maintains for each running application.
The constructors of this class are protected to ensure that the static function IApplication::current returns the correct reference to the only object of this class. Also, the destructor is protected.
![]() |
protected:
virtual ~ICurrentApplication()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
ICurrentApplication()
You can only construct objects of this class with the default constructor, which does not require any arguments.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to access or set the program arguments that can be passed to a program when it is executed.
![]() |
public:
virtual int argc() const
Obtains the number of application arguments.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IString argv(int argumentNumber) const
Obtains the specified argument that is passed to the application.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual ICurrentApplication& setArgs( int argc, const char * const argv [ ] )
Sets the program arguments. Call this member function from your application's main function, passing its argc and argv argument values.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to set and query the color map used by your application.
![]() |
public:
virtual ICurrentApplication& adoptColorMap( IColorMap* colorMap )
Establishes the application-wide color palette used in all drawing operations.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual IColorMap& colorMap() const
Returns the application-wide color map used in all drawing operations. If you do not call IApplication::current().setColorMap to establish your own color map, this function returns IColorMap::webSafeColorMap().
All IFrameWindow constructors call this function to determine the color map to use for drawing in the frame window and the child windows of the frame window.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to access process information.
![]() |
protected:
struct pib_s& pib()
Returns a pointer to the process information block for the current process.
Windows | OS/2 | AIX |
No | Yes | No |
Use these members to access the default resource libraries that Open Class Library uses to load resources that it provides, as well as those provided by your application. These resources include strings, menus, accelerator tables, and bitmaps.
![]() |
public:
virtual IResourceLibrary& resourceLibrary() const
Obtains a reference to the Open Class Library's resource library. Open Class Library loads the resources that it requires from this resource library. To change the name of the resouce library, call ICurrentApplication::setResourceLibrary or set the environment variable ICLUI_RESLIB with the name of the dynamic link library or shared library.
If you do not call ICurrentApplication::setResourceLibrary to identify Open Class Library's resource library, ICurrentApplication::resourceLibrary first searches the NLSPATH and then it searches the LIBPATH to locate the library.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
A dynamic-link library is equivalent to a shared library.
If you do not change the name of the resource library, this function returns a handle to libvacocres.o.
If this function cannot find the resource library using NLSPATH and LIBPATH, it searches for the resource library in /usr/vacpp/loc/C.
You can set the environment variable, ICLUI_RESLIB, using the statement export ICLUI_RESLIB=newname from an operating system command line.
If you do not change the name of the resource library, this function returns a handle to cpporr40.dll.
You can set the environment variable, ICLUI_RESLIB, using the statement set ICLUI_RESLIB=newname from an operating system command line.
If you do not change the name of the resource library, this function returns a handle to cpporr40.dll.
You can set the environment variable, ICLUI_RESLIB, using the statement set ICLUI_RESLIB=newname from an operating system command line.
![]() |
public:
virtual ICurrentApplication& setResourceLibrary( const char* resLibName, IDynamicLinkLibrary::ESearchLocation searchLocation = IDynamicLinkLibrary::kOSDefaultSearch )
Sets the default resource library for Open Class Library resources, returned by resourceLibrary. Open Class Library uses this resouce library to load the resources it provides, such as bitmaps and text for standard toolbar buttons.
You specify a resource library using the name of a dynamic link library or a value of 0. If you specifiy 0, Open Class Library attempts to load its resources from the application's executable file.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
A dynamic-link library is equivalent to a shared library. You can optionally specify the .o extension when naming a shared library.
If you do not call this function, Open Class Library loads its resources from libvacocres.o.
To specify a dynamic link library (DLL)
as the resource library,
do not include its file extension when passing its name to this function.
If you do not call this function,
Open Class Library loads its resources from cpporr40.dll.
Note:
To specify a dynamic link library (DLL)
as the resource library,
do not include its file extension when passing its name to this function.
If you do not call this function,
Open Class Library loads its resources from cpporr40.dll.
Note:
![]() |
public:
virtual ICurrentApplication& setUserResourceLibrary( const char* resLibName, IDynamicLinkLibrary::ESearchLocation searchLocation = IDynamicLinkLibrary::kOSDefaultSearch )
Sets the default resource library for application-defined resources,
returned by
userResourceLibrary.
Open Class Library uses this resource library to load an application-defined resource
when you do not otherwise identify a resource library.
You can specify a resource library when constructing an
IResourceId
object to identify a resource.
If you do not call setUserResourceLibrary,
the default application-defined resource library is the executable file.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
A dynamic-link library is equivalent to a shared library. You can optionally specify the .o extension when naming a shared library.
To specify a dynamic link library (DLL) as the resource library, do not include its file extension when passing its name to this function.
To specify a dynamic link library (DLL) as the resource library, do not include its file extension when passing its name to this function.
![]() |
public:
virtual IResourceLibrary& userResourceLibrary() const
Obtains a reference to the default resource library that Open Class Library uses to load application-defined resources for this application. If you do not explicitly specify an application-defined resource library via setUserResourceLibrary, IResourceId uses the executable file.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to start or stop the current process.
![]() |
public:
virtual ICurrentApplication& exit()
Ends the current thread of execution by calling ICurrentThread::exit. If the current thread is thread 1, the process ends.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual ICurrentApplication& run()
Starts the processing of events in the current process by calling ICurrentThread::processMsgs.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual INonGUIApplication& adjustPriority( long adjustment, bool setDescendents = false )
virtual IString asDebugInfo() const
virtual IString asString() const
static ICurrentNonGUIApplication& current()
static IProcessId currentPID()
virtual IProcessId id() const
virtual INonGUIApplication& setPriority( PriorityClass priorityClass, long priorityLevel = 0, bool setDescendents = false )
virtual INonGUIApplication& setProcessPriority( const EProcessPriority newPrio )
static ICurrentApplication& current()
virtual ~IApplication()
IApplication(const IProcessId& id)
virtual ~INonGUIApplication()
INonGUIApplication(const IProcessId& id)
virtual INonGUIApplication& setId(const IProcessId& id)