- Oct 30, 2000
- 42,589
- 5
- 0
See bold answersWhen I generate win32 window app, so I have these lines in the winapi.cpp:
Should not these line be in the winapi.h when it just declares the functions which implementation is bellow?Code:ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
By having them in the source code; they are essentially private functions; no other piece of code in a different file can call them
Also I sometimes see something similar:
there is the DLGPROC and I don't understand if is is a type or macro defined in some header file? What this piece of code doesCode:DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, // A POINTER TO DIALOG BOX PROCEDURE - declared on begin of this file (DLGPROC)About);
(DLGPROC)About
does it declare a type or what? Why the brackets must be there?
The (DLBPROC) declares the type of the About method to the DialogBox method. The initial definition of About is LRESULT CALLBACK