打开播放文件代码,把它转为delphi(50)

  • 主题发起人 常广荣
  • 开始时间

常广荣

Unregistered / Unconfirmed
GUEST, unregistred user!
CFileDialog m_Dlg(TRUE,NULL,NULL,OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT,"所有支持的文件(*.asf;*.avi;*.tds)|*.asf;*.avi;*.tds|asf文件(*.asf)|*.asf|avi文件(*.avi)|*.avi|tds文件(*.tds)|*.tds|所有文件(*.*)|*.*||",this); if(m_Dlg.DoModal() == IDOK) { CString strFile,strPath,strTime; CStringList strLst; const char *pFiles[1024]; unsigned long nSecond; for(POSITION pos = m_Dlg.GetStartPosition() ; pos != NULL; ) { strFile = m_Dlg.GetNextPathName(pos); strLst.AddTail(strFile); } int i = 0; for(pos = strLst.GetHeadPosition() ; pos != NULL ; ) { strFile = strLst.GetNext(pos); pFiles = strFile; i++; }}
 
没有人会吗?
 
CFileDialog -> TOpenDialogDoModal -> ExecutestrLst -> OpenDialog1.Files自己搞搞吧!
 
to dafuwenn能写全一点吗 CFileDialog m_Dlg(TRUE,NULL,NULL,OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT,"所有支持的文件(*.asf;*.avi;*.tds)|*.asf;*.avi;*.tds|asf文件(*.asf)|*.asf|avi文件(*.avi)|*.avi|tds文件(*.tds)|*.tds|所有文件(*.*)|*.*||",this); if(m_Dlg.DoModal() == IDOK) { CString strFile,strPath,strTime; CStringList strLst; const char *pFiles[1024]; unsigned long nSecond; for(POSITION pos = m_Dlg.GetStartPosition() ; pos != NULL; ) { strFile = m_Dlg.GetNextPathName(pos); strLst.AddTail(strFile); } int i = 0; for(pos = strLst.GetHeadPosition() ; pos != NULL ; ) { strFile = strLst.GetNext(pos); pFiles = strFile; i++; } DVSPLAYER_OpenFile(m_hPlayer,pFiles,strLst.GetCount()); DVSPLAYER_GetFileTime(m_hPlayer,&nSecond); strTime.Format("%02d:%02d:%02d",nSecond/3600,(nSecond/60)%60,nSecond%60); GetDlgItem(IDC_STATIC_ENDTIME)->SetWindowText(strTime); m_cSliderTime.SetRange(0,nSecond); DVSPLAYER_StartAudio(m_hPlayer); OnBtnPlay();
 
type TPCharArray = array of pchar;function DVSPLAYER_OpenFile(hPlayer: Thandle; const pFiles: TPCharArray; nFileCount: integer): integer; stdcall;pFiles这个数组指针用来存放播放文件地址怎样给pFiles这个指针数组赋值呢,文件名从opendialog1中读取
 
顶部 底部