Re[5]: Почему не создается окно?
От: FlashBack  
Дата: 18.05.03 19:30
Оценка:
Здравствуйте, Green_B, Вы писали:


G_B>Вот так выглядит функция ВинМэйн (если не хватит — прошу адрес e-mail, мыльну проект, а пока заранее спасибо):



G_B>
G_B>int APIENTRY WinMain(HINSTANCE hInstance,
G_B>                     HINSTANCE hPrevInstance,
G_B>                     LPSTR     lpCmdLine,
G_B>                     int       nCmdShow)
G_B>{
G_B>    MSG msg;


G_B>    HWND list,wnd;

G_B>    // wnd = CreateDialog(NULL,(LPCSTR)IDD_DIALOG1,NULL,(DLGPROC)LoopD);//!!!!!!!!?!?!?!

//Надо так:
wnd = CreateDialog(NULL,MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC); 
// И всё будет ок :up: 

G_B>    if(!wnd)
G_B>    {
G_B>        MessageBox(NULL,"ÍÅ ÌÎÃÓ ÑÎÇÄÀÒÜ ÎÊÍÎ","WARNING",0);
G_B>        return FALSE;
G_B>    }
    
G_B>    list = GetDlgItem(wnd,(int)ID_LIST);
G_B>    SetTimer(wnd,1,1000,NULL);

G_B>    CreateList(list);

G_B>    isConnect = FALSE;
    

G_B>    while (GetMessage(&msg, NULL, 0, 0)) 
G_B>    {
G_B>            TranslateMessage(&msg);
G_B>            DispatchMessage(&msg);
G_B>    }

    

G_B>    return 1;
G_B>}
G_B>



Цитирую MSDN:

lpTemplate
[in] Specifies the dialog box template. This parameter is either the pointer to a null-terminated character string that specifies the name of the dialog box template or an integer value that specifies the resource identifier of the dialog box template. If the parameter specifies a resource identifier, its high-order word must be zero and its low-order word must contain the identifier. You can use the MAKEINTRESOURCE macro to create this value.


Так что поправь строчку, и радуйся жизни
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.