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. vc 2005 compile error

vc 2005 compile error

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++visual-studiohelptutorial
4 Posts 3 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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb

    C T 2 Replies Last reply
    0
    • N ns

      I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Open the project properties, go to "C/C++" -> "Preprocessor" and click on the "Preprocessor Definitions" line. A button will appear on the right of this line, click on it this will display a dialog. On this dialog uncheck the "Inherit from parent or project defaults".


      Cédric Moonen Software developer
      Charting control [v1.2]

      N 1 Reply Last reply
      0
      • N ns

        I'm getting errors like this error C2664: 'GetModuleFileNameW' : cannot convert parameter 2 from 'char *' to 'LPWCH' char szFilespec [_MAX_PATH]; // filespec // Get name of .exe file //sans name ::GetModuleFileName (0, szFilespec, _MAX_PATH); and error C2664: 'atoi' : cannot convert parameter 1 from 'ATL::CStringT' to 'const char *' time_t CLogRead::GetTimeFromStrings(char *chDate,char *chTime){ struct tm t; CString tmpStr; CString strMonth; tmpStr = chDate; tmpStr +=" "; tmpStr += chTime; t.tm_year = atoi(tmpStr.Mid(7,4)) - 1900; i seem to recall this is something about Unicode. How do I change my project tio get rid of these compile errors? I'm not familiar with the IDE so if you could direct me how to,I'd appreciate it. thanks, sb

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        ns wrote:

        char szFilespec [_MAX_PATH];

        change this line to using TCHAR instead of char


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        1 Reply Last reply
        0
        • C Cedric Moonen

          Open the project properties, go to "C/C++" -> "Preprocessor" and click on the "Preprocessor Definitions" line. A button will appear on the right of this line, click on it this will display a dialog. On this dialog uncheck the "Inherit from parent or project defaults".


          Cédric Moonen Software developer
          Charting control [v1.2]

          N Offline
          N Offline
          ns
          wrote on last edited by
          #4

          Thanks Cedric, It wanted _AFXDLL after I unchecked the inherited ones, so I entered it by hand. It seems to have gotten past that point now. Apppreciate your help, sb

          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