wxWidgets: interface/wx/init.h File Reference

| Version: 3.1.7

Loading...
Searching...
No Matches
Classes | Functions
init.h File Reference

## Classes
class | wxInitializer
| Create an object of this class on the stack to initialize/cleanup the library automatically. More...

## Functions
bool | wxEntryStart (int &argc, wxChar **argv)
| This function can be used to perform the initialization of wxWidgets if you can't use the default initialization code for any reason.
bool | wxEntryStart (HINSTANCE hInstance, HINSTANCE hPrevInstance=NULL, char *pCmdLine=NULL, int nCmdShow=SW_SHOWNORMAL)
| See wxEntryStart(int&,wxChar**) for more info about this function.
void | wxEntryCleanup ()
| Free resources allocated by a successful call to wxEntryStart().
bool | wxInitialize (int argc=0, wxChar **argv=NULL)
| Initialize the library (may be called as many times as needed, but each call to wxInitialize() must be matched by wxUninitialize()).
void | wxUninitialize ()
| Clean up; the library can't be used any more after the last call to wxUninitialize().

## Function Documentation

## ◆ wxEntryCleanup()

void wxEntryCleanup | ( |  | ) |

Free resources allocated by a successful call to wxEntryStart().

Include file:

    #include <wx/init.h>

## ◆ wxEntryStart() [1/2]

bool wxEntryStart | ( | HINSTANCE | hInstance,
|  | HINSTANCE | hPrevInstance = NULL,
|  | char * | pCmdLine = NULL,
|  | int | nCmdShow = SW_SHOWNORMAL )

See wxEntryStart(int&,wxChar**) for more info about this function.

This is an additional overload of wxEntryStart() provided under MSW only. It is meant to be called with the parameters passed to WinMain().

Note
  The type of pCmdLine is `char` *, even in Unicode build.

Availability: only available for the wxMSW port.

Include file:

    #include <wx/init.h>

## ◆ wxEntryStart() [2/2]

bool wxEntryStart | ( | int & | argc,
|  | wxChar ** | argv )

This function can be used to perform the initialization of wxWidgets if you can't use the default initialization code for any reason.

If the function returns true, the initialization was successful and the global wxApp object wxTheApp has been created. Moreover, wxEntryCleanup() must be called afterwards. If the function returns false, a catastrophic initialization error occurred and (at least the GUI part of) the library can't be used at all.

Notice that parameters `argc` and `argv` may be modified by this function.

Include file:

    #include <wx/init.h>

## ◆ wxInitialize()

bool wxInitialize | ( | int | argc = 0,
|  | wxChar ** | argv = NULL )

Initialize the library (may be called as many times as needed, but each call to wxInitialize() must be matched by wxUninitialize()).

With this function you may avoid wxDECLARE_APP() and wxIMPLEMENT_APP() macros and use wxInitialize() and wxUninitialize() dynamically in the program startup and termination.

Include file:

    #include <wx/init.h>

## ◆ wxUninitialize()

void wxUninitialize | ( |  | ) |

Clean up; the library can't be used any more after the last call to wxUninitialize().

See wxInitialize() for more info.

Include file:

    #include <wx/init.h>