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. Ansi CEdit in MFC unicode dialog

Ansi CEdit in MFC unicode dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 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.
  • Z Offline
    Z Offline
    zkrr01
    wrote on last edited by
    #1

    I have a MFC based dialog compiled with _UNICODE and all works well. Now I want to add a CEdit control and have it support Ansi text instead of unicode. That is, I want the CEdit control to accept ascii test and retrieve ascii text instead of unicode. Can this be done and if so, how?

    A R 2 Replies Last reply
    0
    • Z zkrr01

      I have a MFC based dialog compiled with _UNICODE and all works well. Now I want to add a CEdit control and have it support Ansi text instead of unicode. That is, I want the CEdit control to accept ascii test and retrieve ascii text instead of unicode. Can this be done and if so, how?

      A Offline
      A Offline
      Ahmed Charfeddine
      wrote on last edited by
      #2

      Why don't you do the conversion upon the retrieved text ?

      Push Framework - now released ! http://www.pushframework.com

      Z 1 Reply Last reply
      0
      • A Ahmed Charfeddine

        Why don't you do the conversion upon the retrieved text ?

        Push Framework - now released ! http://www.pushframework.com

        Z Offline
        Z Offline
        zkrr01
        wrote on last edited by
        #3

        I did not ask how to do a conversion. Please read the question!

        A 1 Reply Last reply
        0
        • Z zkrr01

          I did not ask how to do a conversion. Please read the question!

          A Offline
          A Offline
          Ahmed Charfeddine
          wrote on last edited by
          #4

          And I did not show you how to do a conversion, rather I suggested to do a conversion as a way to solve your problem. Please understand my answer!

          Push Framework - now released ! http://www.pushframework.com

          1 Reply Last reply
          0
          • Z zkrr01

            I have a MFC based dialog compiled with _UNICODE and all works well. Now I want to add a CEdit control and have it support Ansi text instead of unicode. That is, I want the CEdit control to accept ascii test and retrieve ascii text instead of unicode. Can this be done and if so, how?

            R Offline
            R Offline
            Roger Allen
            wrote on last edited by
            #5

            If you have a subsclassed CEdit control, you could limit the allowed input to the standard ASCII characters. That way any text retrieved even though UNICODE would still all be in the ASCII range. Some clever stuff may have to be done to handle copy/paste etc but I would think such a method would be workable.

            If you vote me down, my score will only get lower

            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