When is this part of code declared?

Daniel Shepherd 246 Reputation points
2021-07-15T14:27:31.227+00:00

I am following the tutorial on modeless_dialogs.html about dialog boxes. In an example, when it shows the code CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_TOOLBAR), hwnd, ToolDlgProc);, at the end it shows ToolDlgProc. And I have one question. When is this defined? How can I implement this? What do I have to add to define something like that?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,595 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,417 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,525 questions
{count} votes

8 answers

Sort by: Most helpful
  1. Daniel Shepherd 246 Reputation points
    2021-07-17T20:07:02.593+00:00

    I have fixed the error, by calling BOOL CALLBACK right below where it declared the About function. Then, I added a return value to it. The code worked without errors! The dialog box does not open, but that is not related to this issue.

    0 comments No comments

  2. Daniel Shepherd 246 Reputation points
    2021-07-17T20:09:02.637+00:00

    I have fixed the error, by calling BOOL CALLBACK right below where it declared the About function. Then, I added a return value to it. The code worked without errors! The dialog box does not open, but that is not related to this issue.

    0 comments No comments

  3. Daniel Shepherd 246 Reputation points
    2021-07-17T20:10:10.117+00:00

    I have fixed the error, by calling BOOL CALLBACK right below where it declared the About function. Then, I added a return value to it. The code worked without errors! The dialog box does not open, but that is not related to this issue.

    0 comments No comments