Problème image list : undefined reference to _imageList_Create@20
juju116
Messages postés23Date d'inscriptionsamedi 14 mars 2009StatutMembreDernière intervention 1 février 2010
-
16 mai 2009 à 16:41
juju116
Messages postés23Date d'inscriptionsamedi 14 mars 2009StatutMembreDernière intervention 1 février 2010
-
20 mai 2009 à 17:33
j'ai un souci avec ma fonction image list, comme le dis le sujet lors
de la compilation j'ai le message suivant: undefined reference to
_imageList_Create@20 , j'ai due oublier quelque chose mais je ne vois
pas quoi, voilà mon code :
int CreateImageList()
{
HIMAGELIST hImageList; /* Handle sur la imagelist */
/*traitement des messages*/
int CALLBACK windowsprocedure(HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
/*Info sur les tailles min et max de la fenêtre*/
MINMAXINFO *lpMinMaxInfo;
/*Taille de la zone cliente*/
RECT clientRect;
/*retour de la fonction*/
long nResult;
nResult = 0;
/*Pour savoir si le message est traité*/
int bHandled;
bHandled = 0;
int CreateImageList()
{
HIMAGELIST hImageList; /* Handle sur la imagelist */
int nResult;
nResult = 0;
/* Création de la liste */
hImageList = ImageList_Create(GetSystemMetrics(SM_CXICON),
GetSystemMetrics(SM_CYICON),
ILC_MASK, 1, 1);
if (! hImageList) goto the_end;
/* Ajout d'un icône */
if (ImageList_ReplaceIcon(hImageList, -1, LoadIcon(NULL, IDI_APPLICATION)) == -1) goto the_end;
/* Affectation de la imagelist à la listview */
SendMessage(_hListView, LVM_SETIMAGELIST, (WPARAM)LVSIL_NORMAL, (LPARAM)hImageList);
nResult = 1;
the_end:
return nResult;
}
/**
* Crée les items de la listview
*/
void InitListView(HWND hwnd,char *text)
{
LV_ITEM lvi;
/*ajout de la listview*/
int CreateListView()
{
_hListView = CreateWindowEx(0, WC_LISTVIEW, (LPCTSTR)NULL,WS_CHILD | LVS_ICON | WS_VISIBLE,0, 0, 0, 0,_hWnd, NULL, _hThisInstance, NULL);
if (! _hListView) goto the_end;
/*handle pour les tooltips*/
HWND hTips;
/*envoie des message lors du survol des items */
SendMessage(_hListView, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_INFOTIP, LVS_EX_INFOTIP);
/* Pour que WM_NOTIFY arrivent instantanément lors du survol d'un item */
hTips = (HWND)SendMessage(_hListView, LVM_GETTOOLTIPS, 0, 0);
SendMessage(hTips, TTM_SETDELAYTIME, TTDT_INITIAL, 1);
SendMessage(hTips, TTM_SETDELAYTIME, TTDT_RESHOW, 1);
the_end :
return 0 ;
}
/**
* Initialise la fenêtre principale de l'appli.
*/
int CreateMyWindow()
{
WNDCLASSEX wincl; /* Classe de la fenêtre utilisée */
int nResult;
nResult = 0;
/* Création de la classe de fenêtre */
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.style = 0;
wincl.lpfnWndProc = 0;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hInstance = _hThisInstance;
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
wincl.lpszMenuName = 0;
wincl.lpszClassName = _lpAppName;
wincl.hIconSm = NULL;
/* Enregistrement de la classe */
if (! RegisterClassEx(&wincl)) goto the_end;
/* Création de la fenêtre */
_hWnd = CreateWindowEx(0, _lpAppName, _lpAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 500, 300,
HWND_DESKTOP, NULL, _hThisInstance, NULL);
if (! _hWnd) goto the_end;
/* Création de la listview */
if (! CreateListView()) goto the_end;
/* Affichage de la fenêtre */
ShowWindow (_hWnd, SW_SHOW);
nResult = 1;
the_end:
return nResult;
}
/**
* Main
*/
int __cdecl WinMainCRTStartup()
{
MSG messages; /* Messages envoyés à l'application */
INITCOMMONCONTROLSEX initCommon; /* Initialisation de comctl32 */
int nResult;