Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to solve the following problem?

how to solve the following problem?

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestionannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zhiyuan16
    wrote on last edited by
    #1

    dear all any problem? i couldn't find. thanks a lot

    void CMeiTengDlg::OnPause()
    {
    // TODO: Add your control notification handler code here
    if(Pause)
    {
    m_Pause.SetWindowText("Pause");
    MCIWndResume(m_Video);
    Pause = FALSE;
    }
    else
    {
    m_Pause.SetWindowText("UnPause");
    MCIWndPause(m_Video);
    Pause = TRUE;
    }
    }

    void CMeiTengDlg::OnBrowse()
    {
    // TODO: Add your control notification handler code here
    m_Video = NULL;
    if(m_Video == NULL)
    {
    CFileDialog avi(TRUE,NULL,NULL,OFN_HIDEREADONLY,"MP3 Files (*.mp3)|*.mp3|AVI Files(*.avi)|*.avi|");
    if(avi.DoModal() == IDOK)
    {
    m_Path = avi.GetPathName();
    UpdateData(FALSE);

    	}
    }
    

    }

    the resilt of compiling:

    MeiTengDLg.cpp
    .\MeiTengDLg.cpp(235) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [6]' to 'LPCTSTR'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    .\MeiTengDLg.cpp(241) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [8]' to 'LPCTSTR'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    .\MeiTengDLg.cpp(277) : error C2664: 'CFileDialog::CFileDialog(BOOL,LPCTSTR,LPCTSTR,DWORD,LPCTSTR,CWnd *,DWORD,BOOL)' : cannot convert parameter 5 from 'const char [48]' to 'LPCTSTR'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Build log was saved at "file://c:\Documents and Settings\ZhiYuan Li\Desktop\MeiTeng\MeiTeng\Release\BuildLog.htm"
    MeiTeng - 3 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    J 1 Reply Last reply
    0
    • Z zhiyuan16

      dear all any problem? i couldn't find. thanks a lot

      void CMeiTengDlg::OnPause()
      {
      // TODO: Add your control notification handler code here
      if(Pause)
      {
      m_Pause.SetWindowText("Pause");
      MCIWndResume(m_Video);
      Pause = FALSE;
      }
      else
      {
      m_Pause.SetWindowText("UnPause");
      MCIWndPause(m_Video);
      Pause = TRUE;
      }
      }

      void CMeiTengDlg::OnBrowse()
      {
      // TODO: Add your control notification handler code here
      m_Video = NULL;
      if(m_Video == NULL)
      {
      CFileDialog avi(TRUE,NULL,NULL,OFN_HIDEREADONLY,"MP3 Files (*.mp3)|*.mp3|AVI Files(*.avi)|*.avi|");
      if(avi.DoModal() == IDOK)
      {
      m_Path = avi.GetPathName();
      UpdateData(FALSE);

      	}
      }
      

      }

      the resilt of compiling:

      MeiTengDLg.cpp
      .\MeiTengDLg.cpp(235) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [6]' to 'LPCTSTR'
      Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      .\MeiTengDLg.cpp(241) : error C2664: 'CWnd::SetWindowTextW' : cannot convert parameter 1 from 'const char [8]' to 'LPCTSTR'
      Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      .\MeiTengDLg.cpp(277) : error C2664: 'CFileDialog::CFileDialog(BOOL,LPCTSTR,LPCTSTR,DWORD,LPCTSTR,CWnd *,DWORD,BOOL)' : cannot convert parameter 5 from 'const char [48]' to 'LPCTSTR'
      Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      Build log was saved at "file://c:\Documents and Settings\ZhiYuan Li\Desktop\MeiTeng\MeiTeng\Release\BuildLog.htm"
      MeiTeng - 3 error(s), 0 warning(s)
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      I think you've enabled unicode in your project settings. Enclose all your strings inside _T() macro like as follows, so that they will switch accordingly to either ansi or unicode strings.

      m_Pause.SetWindowText( _T("Pause") );

      Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups