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. Coding Text...

Coding Text...

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

    Alright... Using fstream when making a simple database using MFC... Say you want to make every letter another letter (coding)... Is it possible? void CNewAccountDlg::OnOK() { CString strUsername; CString strPassword; GetDlgItemText(IDC_USERNAME,strUsername); GetDlgItemText(IDC_PASSWORD,strPassword); ofstream a_file ( "data/account.dat", ios::ate, ios::app); a_file<< strUsername + " " + strPassword + "\n"; a_file.close(); AfxMessageBox("Account Created."); } Nothing wrong with that... Makes a simple file with Username and Password. How could i break my GetDlgItemText into single CHAR allowing me to change them and regroup them back together? Is it possible to break down a String into single Characters? /* Just a Human Trying to Live in a Computers World. */

    T 1 Reply Last reply
    0
    • N NewbieStats

      Alright... Using fstream when making a simple database using MFC... Say you want to make every letter another letter (coding)... Is it possible? void CNewAccountDlg::OnOK() { CString strUsername; CString strPassword; GetDlgItemText(IDC_USERNAME,strUsername); GetDlgItemText(IDC_PASSWORD,strPassword); ofstream a_file ( "data/account.dat", ios::ate, ios::app); a_file<< strUsername + " " + strPassword + "\n"; a_file.close(); AfxMessageBox("Account Created."); } Nothing wrong with that... Makes a simple file with Username and Password. How could i break my GetDlgItemText into single CHAR allowing me to change them and regroup them back together? Is it possible to break down a String into single Characters? /* Just a Human Trying to Live in a Computers World. */

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      NewbieStats wrote: GetDlgItemText into single CHAR allowing me to change them?Is it possible to break down a String into single Characters? Look for CString::GetAt() NewbieStats wrote: regroup them back together? Is it possible to break down a String into single Characters? look at CString::SetAt(),But beware in this allocate a empty buffer to CString before using CString::SetAt() function


      [Vote One Here, Complete my Survey....] Alok Gupta
      visit me at http://www.thisisalok.tk          "I Think Believe this Will Help"

      N 1 Reply Last reply
      0
      • T ThatsAlok

        NewbieStats wrote: GetDlgItemText into single CHAR allowing me to change them?Is it possible to break down a String into single Characters? Look for CString::GetAt() NewbieStats wrote: regroup them back together? Is it possible to break down a String into single Characters? look at CString::SetAt(),But beware in this allocate a empty buffer to CString before using CString::SetAt() function


        [Vote One Here, Complete my Survey....] Alok Gupta
        visit me at http://www.thisisalok.tk          "I Think Believe this Will Help"

        N Offline
        N Offline
        NewbieStats
        wrote on last edited by
        #3

        Would it be Easier to do that or use; strPassword.SetSel(0,1); // ++ Copy and Paste to New CString and Add all CStrings together?... Seems like a long process, but would it be better? /* Just a Human Trying to Live in a Computers World. */

        T 1 Reply Last reply
        0
        • N NewbieStats

          Would it be Easier to do that or use; strPassword.SetSel(0,1); // ++ Copy and Paste to New CString and Add all CStrings together?... Seems like a long process, but would it be better? /* Just a Human Trying to Live in a Computers World. */

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          NewbieStats wrote: Seems like a long process, but would it be better? Depends on You! just select that way, where you feel comfortable!


          [Vote One Here, Complete my Survey....] Alok Gupta
          visit me at http://www.thisisalok.tk          "I Think Believe this Will Help"

          N 1 Reply Last reply
          0
          • T ThatsAlok

            NewbieStats wrote: Seems like a long process, but would it be better? Depends on You! just select that way, where you feel comfortable!


            [Vote One Here, Complete my Survey....] Alok Gupta
            visit me at http://www.thisisalok.tk          "I Think Believe this Will Help"

            N Offline
            N Offline
            NewbieStats
            wrote on last edited by
            #5

            Okay thanks ill try them both and see which one seems to fit better ;) /* Just a Human Trying to Live in a Computers World. */

            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