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. problem with strings greater then 32ks

problem with strings greater then 32ks

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
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.
  • S Offline
    S Offline
    safee ullah
    wrote on last edited by
    #1

    hello there .. there is a slight problem that i am facing with strings greater then 32k i have a variant bstr containing a string which is greater then 32ks.. 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? 2. how do i truncate this bstr string into strings of sizes 32ks? thanks for the time regards

    D K 2 Replies Last reply
    0
    • S safee ullah

      hello there .. there is a slight problem that i am facing with strings greater then 32k i have a variant bstr containing a string which is greater then 32ks.. 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? 2. how do i truncate this bstr string into strings of sizes 32ks? thanks for the time regards

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

      safeeullah wrote: 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? Why are you wanting to store something that is already stored? If the bstr variable already holds the data, why are you wanting to create another variable to hold that same data?


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      S 1 Reply Last reply
      0
      • D David Crow

        safeeullah wrote: 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? Why are you wanting to store something that is already stored? If the bstr variable already holds the data, why are you wanting to create another variable to hold that same data?


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        S Offline
        S Offline
        safee ullah
        wrote on last edited by
        #3

        yes i have it in a bstr...now i need to break that string into 32k segments..for further manipulations.. how to do it? regards safee

        D 1 Reply Last reply
        0
        • S safee ullah

          yes i have it in a bstr...now i need to break that string into 32k segments..for further manipulations.. how to do it? regards safee

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

          Something like this, maybe:

          BSTR    b = SysAllocString(\_T("This is a 32k string"));
          TCHAR   left\[11\],
                  right\[11\];
          
          \_tcsncpy(left, b, 10);
          left\[10\] = '\\0';
          \_tcsncpy(right, b + 10, 10);
          right\[10\] = '\\0';
          

          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          1 Reply Last reply
          0
          • S safee ullah

            hello there .. there is a slight problem that i am facing with strings greater then 32k i have a variant bstr containing a string which is greater then 32ks.. 1. how do i store this thing? into a buffer?, but then how do i get the size of the bstr string so that i can create a buf of that size? 2. how do i truncate this bstr string into strings of sizes 32ks? thanks for the time regards

            K Offline
            K Offline
            kalyan_reddy
            wrote on last edited by
            #5

            beter to store that much in file..... read from a file.

            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