Recently I've been working on a Click and Create extention and the ease of useing dialogs struck me, so as a side project I started "CK-Prog" for lack of the better name at the time, I planned it to be a simple app that Created a Dialog and that'll be the main window.
But now I've come across a seemingly novice problem, CreateDialog() isn't working, heres the code:
main.cpp -- Sence I very much think the problem is only in main.cpp, I've only put main.cpp source in.
and if anyone finds other problems that might make it go in a undesireble way, plz post it.
int mainProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
SetDlgItemText(hwnd, ID_NAME_EB, "ck4r1");
MessageBox(NULL,"\tCK-Prog\nCKarl's first real program with WinAPI.\n\n(C) Karl 2004","CK-Prog",MB_OK);
case ID_HELLO: // clicked "Hello!"
GetDlgItemText(hwnd, ID_NAME_EB, tmphi, 100);
//^ Put the edit box text into a tmp buffer
//^ put the tmp buffer with "Hello" into hi
//^ pops up the MsgBox with your name in it!
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
HWND WIN_MAIN = NULL;
WIN_MAIN = CreateDialog(GetModuleHandle(NULL), MAKEINTRESOURCE(ID_MAIN), NULL, mainProc);
if(WIN_MAIN == NULL)
MessageBox(WIN_MAIN, "'WIN_MAIN' did not open correctly!","ERROR!",MB_OK | MB_ICONINFORMATION);
return(0);// no error
Here is the error:
C:\Programs\CKProg\main.cpp(53) : error C2664: 'CreateDialogParamA' : cannot convert parameter 4 from 'int (void *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(void)'
THX, CK4R1 0U7