Home > Back-end >  Error C2664 "CFileDialog: : CFileDialog (const CFileDialog &)
Error C2664 "CFileDialog: : CFileDialog (const CFileDialog &)

Time:04-16

VS2015
MFC music player
Void CMFCApplication1Dlg: : Onfilechoice ()
{
//TODO: add the control notification handler code
//TODO: add the control notification handler code
//TODO: add the control notification handler code
Char szFileFilter []="mp3 files (*. Mp3) | *. Mp3 |" "
"Wma files (*. Wma) | *. Wma |" "
"Wav files (*. Wav) | *. Wav |" "
"All files (*. *) | *. * |";//file type filter
(CFileDialog DLG, true, NULL, NULL, OFN_HIDEREADONLY szFileFilter);
If (DLG) DoModal ()==IDOK)
{
Cstrings strFilepath=DLG. GetPathName ();
Cstrings strFilename=DLG. GetFileName ();
SetDlgItemText (IDC_filename strFilename);
Load (this - & gt; M_hWnd, strFilepath);
}
//file all buttons while reading success into optional
GetDlgItem (IDC_play) - & gt; The EnableWindow (true);
GetDlgItem (IDC_pause) - & gt; The EnableWindow (true);
GetDlgItem (IDC_stop) - & gt; The EnableWindow (true);


}


Error may not be able to change, tried various methods, online
Severity code shows the project file line prohibits display status
Error C2664 "CFileDialog: : CFileDialog (const CFileDialog & amp;) ": parameter to 5 from the" char [82] "into" LPCTSTR "MFCApplication1 e: \ paper porcelain fracture \ mfc_pic \ MFCApplication1 \ MFCApplication1 \ mfcapplication1dlg CPP 247

Thank you for your bosses

CodePudding user response:

Error C2664 "CFileDialog: : CFileDialog (const CFileDialog & amp;) ": parameter to 5 from the" char [82] "into" LPCTSTR ", tell you what data type is wrong, for reference: https://blog.csdn.net/simtwo/article/details/6084438? Ops_request_misc=% 257 b % 2522 request 255 fid 253 a % 2522161849494616780357266067% % 2522% % 2522% % 252 c 2522 SCM 253 a % % 2522% 252220140713.130102334.. % 2522% 257 d & amp; Request_id=161849494616780357266067 & amp; Biz_id=0 & amp; Utm_medium=distribute. Pc_search_result. None - task - blog - 2 ~ ~ sobaiduend ~ all default - 2-6084438. Pc_search_result_before_js & amp; Utm_term=LPCTSTR AF BB E4 % % % % % E6 98% 80% E4 % B9 E5 BB B1 E7 % % % % % 88% % 9 e 8 b

CodePudding user response:

Open file dialog box CFileDialog DLG (true, NULL, NULL, OFN_HIDEREADONLY, szFileFilter); Modification:
 char szFileFilter []="mp3 files (*. Mp3) | *. Mp3 |" 
"Wma files (*. Wma) | *. Wma |" "
"Wav files (*. Wav) | *. Wav |" "
"All files (*. *) | *. * |";//file type filter
(CFileDialog DLG, true, NULL, NULL, OFN_HIDEREADONLY cstrings (szFileFilter));
  • Related