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. error from using CString.GetBuffer (MAX_PATH),

error from using CString.GetBuffer (MAX_PATH),

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 5 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.
  • M Offline
    M Offline
    mrby123
    wrote on last edited by
    #1

    CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help

    J L D _ 4 Replies Last reply
    0
    • M mrby123

      CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help

      J Offline
      J Offline
      jeron1
      wrote on last edited by
      #2

      Try taking out the [ifl] from the ftitle object. I don't think you can call GetBuffer() on a character returned from the [] operator.

      CString ftitle;

      fscanf_s(f_ptr_seed_inf,"%s\n",ftitle.GetBuffer(MAX_PATH));

      ftitle.ReleaseBuffer();

      1 Reply Last reply
      0
      • M mrby123

        CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help

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

        Superman already answered this question at http://www.codeproject.com/Messages/4582126/Re-reading-error.aspx[^]; try using his suggestion.

        Use the best guess

        1 Reply Last reply
        0
        • M mrby123

          CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          mrby123 wrote:

          fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH));

          How does this even compile? I would have expected a C2228 error.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          1 Reply Last reply
          0
          • M mrby123

            CString ftitle; fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH)); ftitle[ifl].ReleaseBuffer(); I got error message: Unhandled exception at 0x776015de in MSW_Vib_Model.exe: 0x00000000: The operation completed successfully. Please help

            _ Offline
            _ Offline
            _Superman_
            wrote on last edited by
            #5

            As Richard said, I've already answered this question. You need to change the fscanf_s line as follows -

            fscanf_s(f_ptr_seed_inf,"%s\n",ftitle[ifl].GetBuffer(MAX_PATH), MAX_PATH);

            «_Superman_»  _I love work. It gives me something to do between weekends.

            _Microsoft MVP (Visual C++) (October 2009 - September 2013)

            Polymorphism in C

            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