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. ATL / WTL / STL
  4. error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *'

error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *'

Scheduled Pinned Locked Moved ATL / WTL / STL
helpdata-structuresdebuggingquestion
3 Posts 3 Posters 2 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.
  • S Offline
    S Offline
    Swap9
    wrote on last edited by
    #1

    problem piece of code - if(Function(parm1, parm2, parm3)==0){ error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' parm3 is an array - //char parm3[Buffsize1024]; //was before wchar_t parm3[Buffsize1024]; // I changed to make the application unicode enabled Function is expecting wchar_t but its getting char[1024] from some where. I also changed the function signature to accept wchar_t type in header file. objective is to make the whole code UNICODE enabled. I have added all the tchar.h, wchar.h fiels param 3 has been defined (modified) as wchar_t in all the connected files too. I also tried to cast the string and pass the casted string. CString s(parm3) LPCTSTR p = s; no change in the error. I cant debug yet. Pls help how can I get rid of this error.

    L S 2 Replies Last reply
    0
    • S Swap9

      problem piece of code - if(Function(parm1, parm2, parm3)==0){ error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' parm3 is an array - //char parm3[Buffsize1024]; //was before wchar_t parm3[Buffsize1024]; // I changed to make the application unicode enabled Function is expecting wchar_t but its getting char[1024] from some where. I also changed the function signature to accept wchar_t type in header file. objective is to make the whole code UNICODE enabled. I have added all the tchar.h, wchar.h fiels param 3 has been defined (modified) as wchar_t in all the connected files too. I also tried to cast the string and pass the casted string. CString s(parm3) LPCTSTR p = s; no change in the error. I cant debug yet. Pls help how can I get rid of this error.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Something in your code has not been converted correctly. Go to the source code and look carefully at the line where the error occurs. Also please use <pre> tags around your code so it is more readable, like:

      wchar_t parm3[Buffsize1024];
      if(Function(parm1, parm2, parm3)==0){
      // ...

      1 Reply Last reply
      0
      • S Swap9

        problem piece of code - if(Function(parm1, parm2, parm3)==0){ error - cannot convert parameter 3 from 'char [1024]' to 'wchar_t *' parm3 is an array - //char parm3[Buffsize1024]; //was before wchar_t parm3[Buffsize1024]; // I changed to make the application unicode enabled Function is expecting wchar_t but its getting char[1024] from some where. I also changed the function signature to accept wchar_t type in header file. objective is to make the whole code UNICODE enabled. I have added all the tchar.h, wchar.h fiels param 3 has been defined (modified) as wchar_t in all the connected files too. I also tried to cast the string and pass the casted string. CString s(parm3) LPCTSTR p = s; no change in the error. I cant debug yet. Pls help how can I get rid of this error.

        S Offline
        S Offline
        Subrat 4708266
        wrote on last edited by
        #3

        Have you tried Project properties->Configuration properties->Char set->Unicode

        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