I compiled main2.cpp with BC++ FreeCommandLine tool,
I got this error message :
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
main2.cpp:
Error E2034 main2.cpp 22: Cannot convert 'void *' to 'HFONT__ *' in function __s
tdcall WndProc(HWND__ *,unsigned int,unsigned int,long)
Warning W8057 main2.cpp 100: Parameter 'hPrevInstance' is never used in function
__stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int)
Warning W8057 main2.cpp 100: Parameter 'lpCmdLine' is never used in function __s
tdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int)
*** 1 errors in Compile ***
Here is the WndProc function in main2.cpp:
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CREATE:
{
HFONT hfDefault;
HWND hEdit;
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "",
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
0, 0, 100, 100, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
if(hEdit == NULL)
MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
hfDefault = GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hEdit, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
}
break;
case WM_SIZE:
{
HWND hEdit;
RECT rcClient;
GetClientRect(hwnd, &rcClient);
hEdit = GetDlgItem(hwnd, IDC_MAIN_EDIT);
SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
I really don't how to solve that error...
Please help~