标题:这段代码出错怎么解决
只看楼主
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
结帖率:73.33%
已结贴  问题点数:20 回复次数:2 
这段代码出错怎么解决
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")

void CSoundDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    // TODO: Add your message handler code here and/or call default
    DWORD pos;
    int scrollpos;
    int scrollpos;
    if(pScrollBar->m_hWnd==m_left.m_hWnd)
    {
        scrollpos=m_left.GetPos();
        ::waveOutGetVolume(0,&pos);
        pos=pos&0x0000ffff|(scrollpos<<8);
        ::waveOutSetVolume(0,pos);
    }
    if(pScrollBar->m_hWnd==m_right.m_hWnd)
    {
        scrollpos=m_right.GetPos();
        ::waveOutGetVolume(0,&pos);
        pos=pos&0xffff0000|(scrollpos<<24);
        ::waveOutSetVolume(0,pos);
    }
    CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
--------------------Configuration: Sound - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files (x86)\microsoft visual studio\vc98\include\mmsystem.h(114) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files (x86)\microsoft visual studio\vc98\include\mmsystem.h(114) : fatal error C1004: unexpected end of file found

感谢
搜索更多相关主题的帖子: 代码 
2010-09-30 17:51
东海一鱼
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:48
帖 子:757
专家分:4760
注 册:2009-8-10
得分:20 
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
不要断章取义,看看前面的包含文件或定义宏是否与mmsystem.h中的定义冲突。

举世而誉之而不加劝,举世而非之而不加沮,定乎内外之分,辩乎荣辱之境,斯已矣。彼其于世未数数然也。
2010-09-30 21:23
shn521
Rank: 2
等 级:论坛游民
威 望:1
帖 子:56
专家分:52
注 册:2010-6-18
得分:0 
以下是引用东海一鱼在2010-9-30 21:23:36的发言:

#include
#pragma comment(lib,"winmm.lib")
不要断章取义,看看前面的包含文件或定义宏是否与mmsystem.h中的定义冲突。
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")

我什么把#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")放在后面就能运行了,放在前面就不行呢
2010-10-01 15:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-321767-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.103078 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved