2 u011153024 u011153024 于 2013.06.21 13:10 提问

程序编译出错 missing ';' before identifier 'm_ActiveMovie'

错误:
c:\users\administrator.win-42esb6vovun\desktop\lilymp\lilympdlg.h(40) : error C2146: syntax error : missing ';' before identifier 'm_ActiveMovie'
c:\users\administrator.win-42esb6vovun\desktop\lilymp\lilympdlg.h(40) : error C2501: 'CWMPPlayer4' : missing storage-class or type specifiers
c:\users\administrator.win-42esb6vovun\desktop\lilymp\lilympdlg.h(40) : error C2501: 'm_ActiveMovie' : missing storage-class or type specifiers
C:\Users\Administrator.WIN-42ESB6VOVUN\Desktop\LilyMP\LilyMPDlg.cpp(7) : fatal error C1083: Cannot open include file: 'activemovie3.h': No such file or directory

代码:

// LilyMPDlg.cpp : implementation file
//
#pragma once
#include "stdafx.h"
#include "LilyMP.h"
#include "LilyMPDlg.h"
#include "activemovie3.h"

#ifdef DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE
_;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
CAboutDlg();

// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLilyMPDlg dialog

CLilyMPDlg::CLilyMPDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLilyMPDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLilyMPDlg)
m_pathname = _T("");
m_player = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CLilyMPDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLilyMPDlg)
DDX_Control(pDX, IDC_BUTTON9, m_delvol);
DDX_Control(pDX, IDC_LIST2, m_list);
DDX_Control(pDX, IDC_BUTTON8, m_addvol);
DDX_Control(pDX, IDC_BUTTON6, m_next);
DDX_Control(pDX, IDC_BUTTON5, m_circle);
DDX_Control(pDX, IDC_BUTTON4, m_pause);
DDX_Control(pDX, IDC_BUTTON3, m_upper);
DDX_Control(pDX, IDC_BUTTON2, m_play);
DDX_Control(pDX, IDC_BUTTON10, m_mute);
DDX_Control(pDX, IDC_BUTTON1, m_open);
DDX_LBString(pDX, IDC_LIST2, m_pathname);
DDX_Slider(pDX, IDC_SLIDER1, m_player);
DDX_Control(pDX, IDC_OCX6, m_ActiveMovie);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CLilyMPDlg, CDialog)
//{{AFX_MSG_MAP(CLilyMPDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnOpen)
ON_BN_CLICKED(IDC_BUTTON2, OnPlay)
ON_BN_CLICKED(IDC_BUTTON3, OnUpper)
ON_BN_CLICKED(IDC_BUTTON4, OnPause)
ON_BN_CLICKED(IDC_BUTTON6, OnNext)
ON_BN_CLICKED(IDC_BUTTON5, OnCircle)
ON_BN_CLICKED(IDC_BUTTON8, OnAddvol)
ON_BN_CLICKED(IDC_BUTTON9, OnDelvol)
ON_BN_CLICKED(IDC_BUTTON10, OnMute)
ON_NOTIFY(NM_OUTOFMEMORY, IDC_SLIDER1, OnOutofmemorySlider1)
ON_LBN_SELCHANGE(IDC_LIST2, OnSelchangeList2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLilyMPDlg message handlers

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

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
    CString strAboutMenu;
    strAboutMenu.LoadString(IDS_ABOUTBOX);
    if (!strAboutMenu.IsEmpty())
    {
        pSysMenu->AppendMenu(MF_SEPARATOR);
        pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
}

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);         // Set big icon
SetIcon(m_hIcon, FALSE);        // Set small icon

// TODO: Add extra initialization here
/*this->m_pause.EnableWindow(FALSE);
this->m_play.EnableWindow(FALSE);
this->m_next.EnableWindow(FALSE);
this->m_circle.EnableWindow(FALSE);*/
return TRUE;  // return TRUE  unless you set the focus to a control

}

void CLilyMPDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CLilyMPDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

    SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

    // Center icon in client rectangle
    int cxIcon = GetSystemMetrics(SM_CXICON);
    int cyIcon = GetSystemMetrics(SM_CYICON);
    CRect rect;
    GetClientRect(&rect);
    int x = (rect.Width() - cxIcon + 1) / 2;
    int y = (rect.Height() - cyIcon + 1) / 2;

    // Draw the icon
    dc.DrawIcon(x, y, m_hIcon);
}
else
{
    CDialog::OnPaint();
}

}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CLilyMPDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}

void CLilyMPDlg::OnOpen() //添加文件到列表
{
char szFileFilter[]=
"所有文件(*.*)|*.*|" //可选择所有格式的媒体文件
"avi FILE(*.avi)|*.avi|"
"mp3 FILE(*.mp3)|*.mp3|"
"mpeg FILE(*.mpeg)|*.mpeg|"
"mpga FILE(*.mpga)|*.mpga|"
"wave FILE(*.wav)|*.wav|"
"movie FILE(*.mov)|*.mov|"
"mid FILE(*.mid;*.rmi)|*.mid;*.rmi|"
"wma FILE(*.wma)|*.wma|"
"media FILE(*.asf)|*.asf|";
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,szFileFilter);
POSITION pos=dlg.GetStartPosition();
if(dlg.DoModal()==IDOK) //消息响应
{while(pos!=NULL)
{m_pathname=dlg.GetNextPathName(pos);
m_list.AddString(m_pathname);} //将选中的文件加入到播放列表中
}

}

void CLilyMPDlg::OnPlay() //播放媒体文件
{ CString str;
if(m_list.GetCount()<=0)MessageBox("请先打开最少一个媒体文件!","Warning",MB_OK);
else
{if(m_list.GetCurSel()<0){m_list.SetCurSel(0);}
int index=m_list.GetCurSel();
m_list.GetText(index,str);//获取当前选中文件信息
m_ActiveMovie.Run();//播放当前选中文件
SetTimer(0,50,0);
}

}

void CLilyMPDlg::OnCircle()
{
int i;
for(i=0;i<50;i++)
OnNext();

}

void CLilyMPDlg::OnUpper()//上一曲
{CString str;
int index=m_list.GetCurSel();
if (index==0)index=m_list.GetCount();
m_list.GetText(index-1,str);
m_ActiveMovie.SetUrl(str);
m_list.SetCurSel(index-1);
}

void CLilyMPDlg::OnPause() //暂停/继续
{CString strtemp;
if((m_player.GetPlayState()==2)|| (m_player.GetPlayState()==3))
{
GetDlgItemText(IDC_BUTTON4,strtemp);//获取按钮上的字符
if(strtemp.Compare("暂停")==0)//若显示“暂停”,点击暂停,并显示 “继续”
{m_ActiveMovie.Pause();
SetDlgItemText(IDC_BUTTON4,"继续");}
if(strtemp.Compare("继续")==0)//实现从暂停点继续播放,并显示 “暂停”
{m_ActiveMovie.Run();
SetDlgItemText(IDC_BUTTON4,"暂停");}

}
else;
}

void CLilyMPDlg::OnNext() //下一曲

{CString str;
int index=m_List.GetCurSel();
if (index==m_List.GetCount()-1)index=-1;

m_List.GetText(index+1,str);
m_ActiveMovie.SetUrl(str);
m_list.SetCurSel(index+1);

}

void CLilyMPDlg::OnAddvol() //增大音量
{long Volume=m_ActiveMovie.Getvolme();
m_ActiveMovie.Pause;
m_ActiveMovie.SetVolume(Volume+5);
m_ActiveMovie.Run;
}
void CLilyMPDlg::OnDelvol() //减小音量
{long Volume=m_ActiveMovie.Getvolme();
m_ActiveMovie.Pause;
m_ActiveMovie.SetVolume(Volume-5);
m_ActiveMovie.Run;

}

void CLilyMPDlg::OnMute() //静音
{
m_ActiveMovie.Pause;
m_ActiveMovie.SetVolume(0);
m_ActiveMovie.Run;
}

void CLilyMPDlg::OnSelchangeList2()
{
// TODO: Add your control notification handler code here

}

BEGIN_EVENTSINK_MAP(CLilyMPDlg, CDialog)
//{{AFX_EVENTSINK_MAP(CLilyMPDlg)
ON_EVENT(CLilyMPDlg, IDC_OCX6, 5001 /* OpenStateChange */, OnOpenStateChangeOcx6, VTS_I4)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void CLilyMPDlg::OnOpenStateChangeOcx6(long NewState)
{
// TODO: Add your control notification handler code here

}

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
error C2146: syntax error : missing ')' before identifier 'PRId64'
libavutil/timestamp.h报错:error C2146: syntax error : missing ')' before identifier 'PRId64' error C2059: syntax error : ')'解决方法: 在timestamp.h中加入下面代码#define INT64_C(val) val##i64 #define _64BITARG_ "I64
error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE'
error C2146: syntax error : missing ';' before identifier 'HSEMAPHORE' BSCMAKE: error BK1506 : cannot open file '.\Debug\Rtsp.sbr': No such file or directory 执行 bscmake.exe 时出错.   错误原因: 没导入相应的库函
关于syntax error : missing ';' before identifier 'PVOID64' 问题
<br /> 这个问题在网站也有很多人总结:<br /><br />PVOID64 的错误消失,原因如下:<br />POINTER_64 是一个宏,在 64 位编译下起作用,它包含在 SDK 目录下的 BASETSD.H 中( Microsoft Visual Studio 8/VC/PlatformSDK/Include/basetsd.h(23):#define POINTER_64 __ptr64 ),但DXSDK 自己也带了一个 basetsd.h ,里面没有定义 POINTER_64 ,从而导致
解决:../../../winnt.h(222) : error C2146: syntax error : missing ';' before identifier 'PVOID64'的问题
调整 DirectShow/Include 在 Tools -> Options -> Projects and Solutions -> VC++ Directories -> Show Directories for –> Include Files 中的位置(把它下移到最下面),然后把 Project -> Properties -> Configuration Properties –
MySQL 和 c++ 连接时报错error C2146: syntax error : missing ';' before identifier 'fd'
MySQL 和 c++ 连接时报错error C2146: syntax error : missing ';' before identifier 'fd'(2010-12-27 12:51:34) 转载▼ 标签: 杂谈 分类: 计算机 今天用mysq c++ api +Visual studio 2005 编程时编译器报错: c:\pro
error C2146: syntax error : missing ';' before identifier 'fd'
这几天用mysql5.1 c++ api +VC6.0编程时编译器报错:error C2146: syntax error : missing ; before identifier fd跟进mysql_com.h文件中的  my_socket fd;     /* For Perl DBI/dbd */行,发现编译器对my_socket不能识别,而在mysql.h中对my_socke
最终解决error C2146: syntax error : missing ';' before identifier的问题
大家不用找分号了,头文件的问题,要不就是没包含windows.h,要不就是循环包含了某个头文件,要不改一下头文件的顺序就可以了。 做了个小程序,吃过了循环包含头文件的苦了
error C2146: syntax error : missing ';' before identifier 'PVOID64'
error C2146: syntax error : missing ; before identifier PVOID64由 directdraw 的升级引起在网上查了下资料,一般的解决方法是:解决方法:在winnt.h中加上以下语句#define POINTER_64 __ptr64typedef void *PVOID;typedef void * POINTER_
winnt.h error C2146: syntax error : missing ';' before identifier 'PVOID64'
http://www.cnblogs.com/RunOnTheWay/archive/2008/01/17/1043705.html 上次开发DirectShow还是2005年1月,整整两年,今天又重操旧业。 这次在VS2005上使用DirectShow,首次编译发现出现以下错误: error C2146: syntax error : missing ';' before iden
error C2143: syntax error : missing ';' before (identifier) 'xxxx'
编号:C2143 直译:在(标志符)“xxxx”前缺少分号。 错误分析: 这是VC6的编译期最常见的误报,当出现这个错误时,往往所指的语句并没有错误,而是它的上一句语句发生了错误。其实,更合适的做法是编译器报告在上一句语句的尾部缺少分号。上一句语句的很多种错误都会导致编译器报出这个错误: (1)       上一句语句的末尾真的缺少分号。那么补上就可以了。 (2)       上一句语句