Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update your-first-windows-program.md #1893

Open
wants to merge 1 commit into
base: docs
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions desktop-src/LearnWin32/your-first-windows-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ It may be useful to give a brief outline of what this code does. Later topics wi

Notice that the program does not explicitly call the `WindowProc` function, even though we said this is where most of the application logic is defined. Windows communicates with your program by passing it a series of *messages*. The code inside the **while** loop drives this process. Each time the program calls the [**DispatchMessage**](/windows/desktop/api/winuser/nf-winuser-dispatchmessage) function, it indirectly causes Windows to invoke the WindowProc function, once for each message.

**Note:** In case of the error "LNK2019: unresolved external symbol main referenced in function "int_cdeclinvoke_main(void)"":

1. **Open Project Properties:**
- Right-Click on your project in the Solution Explorer.
- Select "Properties"

2. **Change Subsystem:**
- Go to "Configuration Properties" -> "Linker" -> "System".
- Ensure that the "Subsystem" is set to "Windows (/SUBSYSTEM:WINDOWS)".

This happens because the linker is unable to find the *main* function, which is the entry point for a console application. However, since you are writing a Windows application, the entry point should be wWinMain instead of main.

## In this section

- [Creating a Window](creating-a-window.md)
Expand Down