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 convert TCHAR[] to CString?

How to convert TCHAR[] to CString?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 3 Posters 1 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.
  • E Offline
    E Offline
    Exceter
    wrote on last edited by
    #1

    Hi, how to do it properly? I tried following: TCHAR tch[20]; CString str; ..... str = tch; but Have an error, do not what kind of, know that because of the assignment. Thanx.

    D 1 Reply Last reply
    0
    • E Exceter

      Hi, how to do it properly? I tried following: TCHAR tch[20]; CString str; ..... str = tch; but Have an error, do not what kind of, know that because of the assignment. Thanx.

      D Offline
      D Offline
      Dominik Reichl
      wrote on last edited by
      #2

      Exceter wrote: TCHAR tch[20]; CString str; str = tch; I just tried the code you posted and it works just fine... The error must be something other in your code. Can you perhaps post the compiler/linker output? -Dominik


      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

      E 1 Reply Last reply
      0
      • D Dominik Reichl

        Exceter wrote: TCHAR tch[20]; CString str; str = tch; I just tried the code you posted and it works just fine... The error must be something other in your code. Can you perhaps post the compiler/linker output? -Dominik


        _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;)

        E Offline
        E Offline
        Exceter
        wrote on last edited by
        #3

        Yes, it worked fine for me too, at least for last 2 months. but yesterday it stopped working. I checked that in DEBUG. :eek:Unbelievable, now it is working, I changed nothing in the code, NOTHING, it works:omg: What is going on!!!

        R 1 Reply Last reply
        0
        • E Exceter

          Yes, it worked fine for me too, at least for last 2 months. but yesterday it stopped working. I checked that in DEBUG. :eek:Unbelievable, now it is working, I changed nothing in the code, NOTHING, it works:omg: What is going on!!!

          R Offline
          R Offline
          RChin
          wrote on last edited by
          #4

          Exceter wrote: I changed nothing in the code, NOTHING, Ha,Ha. I've had my share of random compiler errors in my early programming years as well. But as I later find out, 9/10 times it was my fault, or there was an explanation (however obscure it may be).


          "..Even my comments have bugs!"
          Inspired by Toni78

          E 2 Replies Last reply
          0
          • R RChin

            Exceter wrote: I changed nothing in the code, NOTHING, Ha,Ha. I've had my share of random compiler errors in my early programming years as well. But as I later find out, 9/10 times it was my fault, or there was an explanation (however obscure it may be).


            "..Even my comments have bugs!"
            Inspired by Toni78

            E Offline
            E Offline
            Exceter
            wrote on last edited by
            #5

            But 1/10 errors of your code was because of the compiler. but as I said, my program was working, and I got that error. and later, it started working again. I do not think that was my fault. thanx.

            1 Reply Last reply
            0
            • R RChin

              Exceter wrote: I changed nothing in the code, NOTHING, Ha,Ha. I've had my share of random compiler errors in my early programming years as well. But as I later find out, 9/10 times it was my fault, or there was an explanation (however obscure it may be).


              "..Even my comments have bugs!"
              Inspired by Toni78

              E Offline
              E Offline
              Exceter
              wrote on last edited by
              #6

              But 1/10 errors of your code was because of the compiler. but as I said, my program was working, and I got that error. and later, it started working again. I do not think that was my fault. thatnx.

              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