天嵌 ARM开发社区

 找回密码
 注册
查看: 2486|回复: 2

打开wav文件

[复制链接]
wjr880301 发表于 2010-5-28 16:48:31 | 显示全部楼层 |阅读模式
亚瑟王:
    你好!我最近使用天嵌的开发板,我现在做一个录音播放的功能,我现在要打开一个文件,可是出错
void CRecorderDlg::OnBnClickedRecOpen()
{CString strFilter = _T("Wav File (*.wav) | *.wav|");//过滤文件类型
        strFilter += "All File (*.*) | *.*|";

        CFileDialog* pBrowse;
        pBrowse = new CFileDialog(
                TRUE,        // BOOL bOpenFileDialog
                NULL,        // LPCTSTR lpszDefExt = NULL
                NULL,        // LPCTSTR lpszFileName = NULL
                OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST,        // DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT
                strFilter,        // LPCTSTR lpszFilter = NULL
                NULL        // CWnd* pParentWnd = NULL
                );

        if(pBrowse->DoModal() == IDOK)
        {
                POSITION pos=pBrowse->GetStartPosition();
                while(pos)
                        m_lstFile.AddString(pBrowse->GetNextPathName(pos));
               
        }

1>.\RecorderDlg.cpp(497) : error C2065: “m_lstFile”: 未声明的标识符
1>.\RecorderDlg.cpp(497) : error C2228: “.AddString”的左边必须有类/结构/联合
 楼主| wjr880301 发表于 2010-5-28 16:50:10 | 显示全部楼层
public:
        void TranNotifyMsg(DWORD dwMsg);
        void DeleteFile();
        void Play();
        CPlayMP3Dlg(CWnd* pParent = NULL);        // standard constructor

// Dialog Data
        //{{AFX_DATA(CPlayMP3Dlg)
        enum { IDD = IDD_PLAYMP3_DIALOG };
        CComboBox        m_comboMode;
        CListBox        m_lstFile;
        CSliderCtrl        m_Slider;
        int                m_nSliderPos;
        CString        m_strTime;
这是定义

#ifndef _WIN32_WCE
        // Displays the Customize Toolbar dialog box.
        void Customize();
#endif // !_WIN32_WCE
        // Adds one or more strings to the toolbar control's string pool.
        int AddString(_In_ UINT nStringID);
        int AddStrings(_In_z_ LPCTSTR lpszStrings);
亚瑟王 发表于 2010-5-29 16:08:16 | 显示全部楼层
你定义的n_lsFile的作用域有问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号 )

GMT+8, 2024-5-21 14:00 , Processed in 1.015625 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表