MCI_PLAY_PARMS MciPlayParms; //定义MCI参数
DWORD Error;
SetTimer( 1, 1000, NULL ); //设置定时器对象
if(!m_bplay)
{
MciPlayParms.dwCallback = (long)GetSafeHwnd();
MciPlayParms.dwFrom = 0;
Error = mciSendCommand(m_mci,MCI_PLAY,MCI_FROM|MCI_NOTIFY,(DWORD)
怎样输出一首乐曲的长度,请各位看一下,怎样将dword格式转换成字符型输出,下面的程序中输出不对
(LPVOID)&MciPlayParms);
if(Error)
{
Warning(Error);
return;
}
cdlength = getinfo(MCI_STATUS_LENGTH); //得到曲目长度
CString strlength;
int strhour,strminute,strsecond;
cdto = MCI_MAKE_HMS(MCI_HMS_HOUR(cdlength),MCI_HMS_MINUTE(cdlength),MCI_HMS_SECOND(cdlength));
strlength.Format( "%2d:%2d:%2d",cdto ); //转换格式
SetDlgItemText(IDC_TotalTime,strlength);
}
上面的程序可以输出,但是输出不正确。
DWORD Error;
SetTimer( 1, 1000, NULL ); //设置定时器对象
if(!m_bplay)
{
MciPlayParms.dwCallback = (long)GetSafeHwnd();
MciPlayParms.dwFrom = 0;
Error = mciSendCommand(m_mci,MCI_PLAY,MCI_FROM|MCI_NOTIFY,(DWORD)
怎样输出一首乐曲的长度,请各位看一下,怎样将dword格式转换成字符型输出,下面的程序中输出不对
(LPVOID)&MciPlayParms);
if(Error)
{
Warning(Error);
return;
}
cdlength = getinfo(MCI_STATUS_LENGTH); //得到曲目长度
CString strlength;
int strhour,strminute,strsecond;
cdto = MCI_MAKE_HMS(MCI_HMS_HOUR(cdlength),MCI_HMS_MINUTE(cdlength),MCI_HMS_SECOND(cdlength));
strlength.Format( "%2d:%2d:%2d",cdto ); //转换格式
SetDlgItemText(IDC_TotalTime,strlength);
}
上面的程序可以输出,但是输出不正确。
CString str;
str.Format("%d",x);
三个%d应该有三个变量与之对应,你只有一个cdto.
符合你的要求吗?
如果不明白,你可以
(1),给我发短消息(请附帖子的地址).
(2),根据http://www.vcshare.net上的联系方式与我联系,推荐QQ.
(3),如果问题简单,请在http://www.vcshare.net/bbs/default.asp上发帖.
如果问题比较复杂,请把代码压成*.rar当附件发在我的论坛上发帖.
同时在www.csdn.net上发帖,并给出在我的论坛的链接.
---------------
压代码前,请先删除debug,release文件夹,及*.opt,*.ncb,*.plg,*.aps.
如果程序比较大
(1),请写好注释,否则会很头痛.
(2),注明那些类是自己写的,那些是下载的.
用户名:guest ,guest1,guest2,guest3,guest4
密码都是: 123