Click here to Skip to main content
15,894,410 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThanks Pin
CPallini15-Dec-07 5:21
mveCPallini15-Dec-07 5:21 
Generalnon-const reference and const reference Pin
George_George14-Dec-07 17:48
George_George14-Dec-07 17:48 
GeneralRe: non-const reference and const reference Pin
Iain Clarke, Warrior Programmer14-Dec-07 22:36
Iain Clarke, Warrior Programmer14-Dec-07 22:36 
GeneralRe: non-const reference and const reference Pin
George_George15-Dec-07 4:02
George_George15-Dec-07 4:02 
GeneralRe: non-const reference and const reference Pin
Iain Clarke, Warrior Programmer15-Dec-07 4:17
Iain Clarke, Warrior Programmer15-Dec-07 4:17 
GeneralRe: non-const reference and const reference Pin
George_George15-Dec-07 19:27
George_George15-Dec-07 19:27 
QuestionQuestion about redeclaring header files Pin
(Steven Hicks)n+114-Dec-07 15:37
(Steven Hicks)n+114-Dec-07 15:37 
GeneralRe: Question about redeclaring header files Pin
Iain Clarke, Warrior Programmer14-Dec-07 22:56
Iain Clarke, Warrior Programmer14-Dec-07 22:56 
Question"Out Of Memory" When using CString GetBuffer() [modified] Pin
nadiric14-Dec-07 14:09
nadiric14-Dec-07 14:09 
QuestionAdditional Info - "Out Of Memory" When using CString GetBuffer() Pin
nadiric14-Dec-07 15:15
nadiric14-Dec-07 15:15 
GeneralRe: Additional Info - "Out Of Memory" When using CString GetBuffer() Pin
nadiric14-Dec-07 15:37
nadiric14-Dec-07 15:37 
GeneralRe: "Out Of Memory" When using CString GetBuffer() Pin
Mark Salsbery15-Dec-07 8:18
Mark Salsbery15-Dec-07 8:18 
GeneralRe: "Out Of Memory" When using CString GetBuffer() Pin
nadiric15-Dec-07 8:59
nadiric15-Dec-07 8:59 
GeneralRe: "Out Of Memory" When using CString GetBuffer() Pin
Mark Salsbery15-Dec-07 9:06
Mark Salsbery15-Dec-07 9:06 
GeneralHELP, in both senses Pin
Anthony Appleyard14-Dec-07 13:01
Anthony Appleyard14-Dec-07 13:01 
GeneralRe: HELP, in both senses Pin
santhoshv8414-Dec-07 17:33
santhoshv8414-Dec-07 17:33 
GeneralRe: HELP, in both senses Pin
Anthony Appleyard14-Dec-07 19:35
Anthony Appleyard14-Dec-07 19:35 
GeneralRe: HELP, in both senses Pin
nitin314-Dec-07 21:02
nitin314-Dec-07 21:02 
GeneralRe: HELP, in both senses Pin
santhoshv8414-Dec-07 21:07
santhoshv8414-Dec-07 21:07 
GeneralRe: HELP, in both senses Pin
Mark Salsbery15-Dec-07 8:20
Mark Salsbery15-Dec-07 8:20 
QuestionDisplay file details Pin
GPat2414-Dec-07 11:36
GPat2414-Dec-07 11:36 
GeneralRe: Display file details [modified] Pin
Mark Salsbery14-Dec-07 11:58
Mark Salsbery14-Dec-07 11:58 
void PlayerDlg::DoDataExchange(CDataExchange* pDX)
{
DDX_Text(pDX, IDC_AUDIOLIST,m_AudioList); <-- what is m_AudioList?? Calling DDX_Text()? Why?
}

BOOL PlayerDlg::OnInitDialog()
{
CDialog::OnInitDialog();

CFileFind finder;
bool bFound;
CListBox *m_AudioList = (CListBox*)this; <-- Casting a dialog pointer to a CListBox pointer...bad

static const TCHAR szFileToFine[] = _T("d:\\songs\\*.mp3");
bFound = finder.FindFile(szFileToFine);
if(bFound) {

bFound = finder.FindNextFile();
m_AudioList->AddString(finder.GetFileName());
while(bFound) {
bFound = finder.FindNextFile();
if(bFound) {
m_AudioList-> AddString(finder.GetFileName());

}
}}}


Maybe try making m_AudioList a member variable of the dialog class:
CListBox m_AudioList;

Then use it something like this:
void PlayerDlg::DoDataExchange(CDataExchange* pDX)
{
    DDX_Control(pDX, IDC_AUDIOLIST, m_AudioList);
}

BOOL PlayerDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    static const TCHAR szFileToFine[] = _T("d:\\songs\\*.mp3");

    CFileFind finder;
    bool bFound = finder.FindFile(szFileToFine);
    while (bFound)
    {
        bFound = finder.FindNextFile();
        m_AudioList->AddString(finder.GetFileName());
    } 
}

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

modified on Friday, December 14, 2007 6:10:47 PM

GeneralRe: Display file details Pin
Hamid_RT14-Dec-07 21:20
Hamid_RT14-Dec-07 21:20 
QuestionRe: Display file details Pin
GPat2415-Dec-07 23:49
GPat2415-Dec-07 23:49 
QuestionRestricting security in web browser control Pin
drummer14-Dec-07 11:35
drummer14-Dec-07 11:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.