C ++ programming language is a widely used and powerful Programming Application language. It supports common programming languages with Multiple Programming paradigms and supports various programming languages. Here we will introduce the C ++ Operating Mechanism to deepen our understanding of this language.
- Analysis of C ++ enumerative subcorrelation types
- Analysis of C ++ formatted string-related applications
- How to Implement C ++ print address information
- Detailed description of how C ++ generates random numbers
- Practical application skills of C ++ linked list operations
1. windows applications are an event-driven programming model. In the C ++ operating mechanism, messages are primarily based. When a function is required, some support of the system is called. The system packs the function call into a message and delivers it to the Message Queue. Finally, the application removes the message from the message queue and performs the corresponding action.
The system controls the hardware response and behavior. The application is only independent of the hardware that the system interacts. The application sends commands to the system, and then the system controls the hardware for input and output operations. The functions opened by the system to applications are called system functions. These system functions are called windows APIs. The handle is similar to a pointer. Only one resource is identified !) A message queue is an FIFO sequence.
2. In windows C ++, the entry function is the winmain function:
- // When the program runs, every window is an instance.
- Int WINAPI WinMain (
- HINSTANCE hInstance, // ID of the current instance
- HINSTANCE hPrevInstance, // ID of the previous instance
- LPSTR lpCmdLine, // number of lines in the command line parameter
- Int nCmdShow // The status displayed in the window is minimized)
- );
3. Create a window
1) create a window class
2) Registration window
3) create a window
4) display and update window
C ++ calls all functions in the running mechanism process!