--------------------Configuration: gggg - Win32 Debug--------------------
Compiling...
ggggDlg.cpp
C:\Documents and Settings\TOTO\桌面\新建文件夹\gggg\ggggDlg.cpp(175) : error C2065: 'mciSendString' : undeclared identifier

解决方案 »

  1.   

    #include "mmsystem.h"Header: Declared in mmsystem.h.
    Import Library:  winmm.lib.
      

  2.   

    打开CD-ROM
    mciSendString("Set cdAudio door open wait",NULL,0,NULL);我想用一个按钮实现上面的功能,怎么办呢?我往那个TODO里面写了mciSendString("Set cdAudio door open wait",NULL,0,NULL);
    之后,出现
    --------------------Configuration: gggg - Win32 Debug--------------------
    Compiling...
    ggggDlg.cpp
    C:\Documents and Settings\TOTO\桌面\新建文件夹\gggg\ggggDlg.cpp(175) : error C2065: 'mciSendString' : undeclared identifier怎么解决?高人指点
      

  3.   

    包含
    #include "mmsystem.h"
    之后
    --------------------Configuration: okjkjkjk - Win32 Debug--------------------
    Compiling...
    okjkjkjkDlg.cpp
    Linking...
    okjkjkjkDlg.obj : error LNK2001: unresolved external symbol __imp__mciSendStringA@16
    Debug/okjkjkjk.exe : fatal error LNK1120: 1 unresolved externals
    执行 link.exe 时出错.okjkjkjk.exe - 1 error(s), 0 warning(s)
    包含
    #include "mmsystem.h"Header: Declared in mmsystem.h.
    Import Library:  winmm.lib.
    之后
    --------------------Configuration: okjkjkjk - Win32 Debug--------------------
    Compiling...
    okjkjkjkDlg.cpp
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(10) : error C2501: 'Header' : missing storage-class or type specifiers
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(10) : error C2239: unexpected token ':' following declaration of 'Header'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(10) : error C2061: syntax error : identifier 'in'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(22) : error C2059: syntax error : '<class-head>'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(23) : error C2630: ';' found in what should be a comma-separated list
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(45) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(45) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(45) : error C2065: 'IDD' : undeclared identifier
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(46) : error C2550: 'CAboutDlg' : constructor initializer lists are only allowed on constructor definitions
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(49) : warning C4508: 'CAboutDlg' : function should return a value; 'void' return type assumed
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(51) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(53) : error C2248: 'DoDataExchange' : cannot access protected member declared in class 'CWnd'
            e:\microsoft visual studio\vc98\mfc\include\afxwin.h(2414) : see declaration of 'DoDataExchange'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(53) : error C2352: 'CWnd::DoDataExchange' : illegal call of non-static member function
            e:\microsoft visual studio\vc98\mfc\include\afxwin.h(2414) : see declaration of 'DoDataExchange'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2248: 'messageMap' : cannot access protected member declared in class 'CDialog'
            e:\microsoft visual studio\vc98\mfc\include\afxwin.h(2667) : see declaration of 'messageMap'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2270: 'GetMessageMap' : modifiers not allowed on nonmember functions
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2065: 'messageMap' : undeclared identifier
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2373: 'messageMap' : redefinition; different type modifiers
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2065: '_messageEntries' : undeclared identifier
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2109: subscript requires array or pointer type
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2102: '&' requires l-value
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2653: 'CAboutDlg' : is not a class or namespace name
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(58) : error C2040: '_messageEntries' : 'const struct AFX_MSGMAP_ENTRY []' differs in levels of indirection from 'int'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(104) : error C2065: 'THIS_FILE' : undeclared identifier
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(133) : error C2146: syntax error : missing ';' before identifier 'dlgAbout'
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(133) : warning C4551: function call missing argument list
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(133) : error C2065: 'dlgAbout' : undeclared identifier
    C:\Documents and Settings\TOTO\桌面\新建文件夹\okjkjkjk\okjkjkjkDlg.cpp(134) : error C2228: left of '.DoModal' must have class/struct/union type
      

  4.   

    选择 project->Add to Project->Components and Controls->Visual C++ Components
    ->Windows Multimedia library点击Insert插入即可