salut !!
ça sera simpa si vous m'aidiez a corriger ce code
*******************************************************************************
#include <windows.h>
#include "resource.h"
#include <commctrl.h>
#pragma comment(lib,"comctl32.lib")
HWND hTxtIp;
HWND handle;
HINSTANCE hInstance;
BOOL CALLBACK Dialog_Procedure(UINT message,
WPARAM wparam,
LPARAM lparam)
{
switch(message)
{
case WM_INITDIALOG:
{
INITCOMMONCONTROLSEX lpInitCtrls;
lpInitCtrls.dwSize = sizeof(LPINITCOMMONCONTROLSEX);
lpInitCtrls.dwICC = ICC_INTERNET_CLASSES;
InitCommonControlsEx(&lpInitCtrls);
hTxtIp = CreateWindowEx(WS_EX_CLIENTEDGE, WC_IPADDRESS, "", WS_CHILD | WS_VISIBLE,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
handle, NULL, hInstance, NULL);
UpdateWindow(hTxtIp);
return FALSE;
break;
}
case WM_COMMAND:
{
switch(LOWORD(wparam))
{
case ID_CONNECT:
{
MessageBox(handle,"a fen","e",0);
return true;
break;
}
default:
{
return FALSE;
}
}
return true;
break;
}
case WM_CLOSE:
{
exit(-1);
return true;
break;
}
default:
{
return FALSE;
}
}
return TRUE;
}
int WINAPI WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpcmdLine,
int nCmdLine)
{
hInstance = hThisInstance ;
handle = CreateDialog(hThisInstance,MAKEINTRESOURCE(ID_DIALOG1),
NULL,Dialog_Procedure);
MSG message;
while(GetMessage(&message,NULL,0,0))
{
TranslateMessage(&message);
DispatchMessage(&message);
}
return 0;
}
********************************************************************************
voici l'erreur que le compilateur genere :
D:\Program Files\Microsoft Visual Studio\MyProjects\Client\main.cpp(75) : error C2664: 'CreateDialogParamA' : cannot convert parameter 4 from 'int (unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long
)'
*******************************************************************************
dans le fichier resource j'ai crée une boite dialogue composeé d'un cotrole
IP ADDRESS son id est ID_IP_ADDRESS et un BUTTON ID_CONNECT
merçi d'avance