I am developing a MFC dll, and my code has
// Initialize the list control (Rectangle / Obround / Single D / Double D)
m_shape_image.Create (32, 32, 0, 0, 8);
icon[0] = AfxGetApp()->LoadIcon(IDI_RECTANGLE);
icon[1] = AfxGetApp()->LoadIcon(IDI_OBROUND);
icon[2] = AfxGetApp()->LoadIcon(IDI_SINGLE_D);
icon[3] = AfxGetApp()->LoadIcon(IDI_DOUBLE_D);
for (i = 0; i < N_SHAPES; i++)
m_shape_image.Add (icon);
CListCtrl *list = (CListCtrl *) GetDlgItem (IDC_SHAPES);
list->SetImageList (&m_shape_image, LVSIL_SMALL);
for (i = 0; i < N_SHAPES; i++)
{
get_msg (TEXT_HDR, s, M_SHAPES + i);
list->InsertItem (i, s, i);
}
but when i compile and use the dll, it cannot locate the icons and the list is blank. Is there something wrong with my path settings? or where I need to put the .ico files?
Thanks!
// Initialize the list control (Rectangle / Obround / Single D / Double D)
m_shape_image.Create (32, 32, 0, 0, 8);
icon[0] = AfxGetApp()->LoadIcon(IDI_RECTANGLE);
icon[1] = AfxGetApp()->LoadIcon(IDI_OBROUND);
icon[2] = AfxGetApp()->LoadIcon(IDI_SINGLE_D);
icon[3] = AfxGetApp()->LoadIcon(IDI_DOUBLE_D);
for (i = 0; i < N_SHAPES; i++)
m_shape_image.Add (icon);
CListCtrl *list = (CListCtrl *) GetDlgItem (IDC_SHAPES);
list->SetImageList (&m_shape_image, LVSIL_SMALL);
for (i = 0; i < N_SHAPES; i++)
{
get_msg (TEXT_HDR, s, M_SHAPES + i);
list->InsertItem (i, s, i);
}
but when i compile and use the dll, it cannot locate the icons and the list is blank. Is there something wrong with my path settings? or where I need to put the .ico files?
Thanks!