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. While Splitting the String* it throws Error....

While Splitting the String* it throws Error....

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 4 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
    spalanivel
    wrote on last edited by
    #1

    Hi, In the strCommand I am having 2MB of Data and when i am trying to split with the new line it was throwing error.(to loop through all the data) But it was working for minminum (ie 50 KB of datas like 0's and 1's). How to over come this error? Very urgent.. Below is the code... CString strCommand; // Holds 2MB of datas like 0's and 1's... System::String* strDataReceived = ""; strDataReceived = strCommand; __wchar_t split __gc[] = new __wchar_t __gc[1]; split [0] = '\n'; String *strSplitCommand[] = strDataReceived->Trim()->Split (split); Please help.. Reg, Subbu

    C D S 3 Replies Last reply
    0
    • S spalanivel

      Hi, In the strCommand I am having 2MB of Data and when i am trying to split with the new line it was throwing error.(to loop through all the data) But it was working for minminum (ie 50 KB of datas like 0's and 1's). How to over come this error? Very urgent.. Below is the code... CString strCommand; // Holds 2MB of datas like 0's and 1's... System::String* strDataReceived = ""; strDataReceived = strCommand; __wchar_t split __gc[] = new __wchar_t __gc[1]; split [0] = '\n'; String *strSplitCommand[] = strDataReceived->Trim()->Split (split); Please help.. Reg, Subbu

      C Offline
      C Offline
      CPallini
      wrote on last edited by
      #2

      spalanivel wrote:

      Very urgent..

      It is so urgent to justify the cross-post [^]? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      1 Reply Last reply
      0
      • S spalanivel

        Hi, In the strCommand I am having 2MB of Data and when i am trying to split with the new line it was throwing error.(to loop through all the data) But it was working for minminum (ie 50 KB of datas like 0's and 1's). How to over come this error? Very urgent.. Below is the code... CString strCommand; // Holds 2MB of datas like 0's and 1's... System::String* strDataReceived = ""; strDataReceived = strCommand; __wchar_t split __gc[] = new __wchar_t __gc[1]; split [0] = '\n'; String *strSplitCommand[] = strDataReceived->Trim()->Split (split); Please help.. Reg, Subbu

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

        spalanivel wrote:

        ...when i am trying to split with the new line it was throwing error.

        My Magic 8-Ball is broken. What is the error that is being "thrown?"

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "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

        1 Reply Last reply
        0
        • S spalanivel

          Hi, In the strCommand I am having 2MB of Data and when i am trying to split with the new line it was throwing error.(to loop through all the data) But it was working for minminum (ie 50 KB of datas like 0's and 1's). How to over come this error? Very urgent.. Below is the code... CString strCommand; // Holds 2MB of datas like 0's and 1's... System::String* strDataReceived = ""; strDataReceived = strCommand; __wchar_t split __gc[] = new __wchar_t __gc[1]; split [0] = '\n'; String *strSplitCommand[] = strDataReceived->Trim()->Split (split); Please help.. Reg, Subbu

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Try giving a little more detail about the error message - I just tried your code (reading > 2MB of data from a file) and it worked fine?

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          S 1 Reply Last reply
          0
          • S Stuart Dootson

            Try giving a little more detail about the error message - I just tried your code (reading > 2MB of data from a file) and it worked fine?

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            S Offline
            S Offline
            spalanivel
            wrote on last edited by
            #5

            Thanks for your reply.. Actually while executing the Split statement we are storing the values String Array and it doesn't hold that much size to handle. It will automatically goes to catch and print the error message. After some processing the Size will be increased and it holds now 40 MB of datas and store it in string array. Thus it makes problem. Thanks, Subbu

            S 1 Reply Last reply
            0
            • S spalanivel

              Thanks for your reply.. Actually while executing the Split statement we are storing the values String Array and it doesn't hold that much size to handle. It will automatically goes to catch and print the error message. After some processing the Size will be increased and it holds now 40 MB of datas and store it in string array. Thus it makes problem. Thanks, Subbu

              S Offline
              S Offline
              Stuart Dootson
              wrote on last edited by
              #6

              As you're using C++.NET classes, the array is dynamically sized, so there should be no issues...

              Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

              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