Trouble with listboxes (MFC)!

Started by
1 comment, last by GekkoCube 22 years, 2 months ago
I have a dialog with a ListBox, IDC_TILE_LLIST. All of the following code(s) have been added to the overrided OnInitDialog() function at one time or another - all with little or no success. ----------------------------- CWnd *cwnd = GetDlgItem(IDC_TILE_LIST); cwnd->DlgDirList(_T("c:\\"), IDC_TILE_LIST, 0, DDL_EXCLUSIVE); note: This doesnt list files inside the ListBox. ----------------------------- ----------------------------- this->DlgDirList(_T("c:\\"), IDC_TILE_LIST, 0, DDL_EXCLUSIVE); note: This doesnt do it either. ----------------------------- Basically, I have a dialog with a listbox (which i created as a resource)..and I would like to display a list of files from a certain directory into that listbox! I can list strings one at a time into the list - it''s no problem. But I would like to display all files at one time and be able to select one or more files. My class, which im trying to do all this in, is derived from CDialog. Please help me if you can! Thank you. ~ I''''m a wannabe programmer ~
Advertisement
Did you try the ''Dir'' function, as in:

  cwnd->Dir(0x10, "*.*");  


Should list all the names of files and directories in the current directory.
yeah!!
I found this out the hard way - trial and error!
But thanks for the help.
I have one more question.

I gots this othe problem.
I would like to display a bitmap inside a static picture box.


// Documentation says when this is called it automatically draws
// to the static box.
// When i do this, the box turns white (for all bitmaps).
SetBitmap( bmp.GetBitmap() );

bmp.GetBitmap() returns a HBITMAP.


~ I''''m a wannabe programmer ~

This topic is closed to new replies.

Advertisement