Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    ReadFileToMemory() in R20 crashes

    Cinema 4D SDK
    c++ macos r20 maxon api
    2
    7
    868
    Loading More Posts
    • 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.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      Hi,

      I know, R20 is a while old, but maybe someone has an idea...

      The following code crashes reproducibly on R20 (definitely on macOS, not yet sure about Windows):

      maxon::Url theServer("https://www.myserver.org/somefolder/somefile.json"_s);
      maxon::BaseArray<Char> memReq;
      iferr (maxon::FileUtilities::ReadFileToMemory(theServer, memReq))
      {
      	DiagnosticOutput("@", err);
      }
      

      Bildschirmfoto 2021-04-11 um 16.39.48.png

      The same (well, almost the same) code works flawlessly in R21 - R23:

      maxon::Url theServer("https://www.myserver.org/somefolder/somefile.json"_s);
      
      // Set post properties (apparently not yet possible in R20)
      theServer.Set(maxon::URLFLAGS::HTTP_POSTMETHOD, method) iferr_return;
      theServer.Set(maxon::URLFLAGS::HTTP_POSTDATA, maxon::CString(postData, maxon::StringEncodings::Utf8())) iferr_return;
      
      maxon::BaseArray<maxon::Char> memReq;
      iferr (maxon::FileUtilities::ReadFileToMemory(theServer, memReq))
      {
      	DiagnosticOutput("@", err);
      }
      

      Thanks in advance for advice!

      Cheers,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        I did tried with R20 and it worked as expected. I'm reading a .txt file from a https link. (i did only tried on windows)
        Could you send us an email with the link you are using ? (just to be sure I'm testing the same thing)

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • fwilleke80F
          fwilleke80
          last edited by

          Hi Manuel,

          thanks for your reply!
          Sure, what was the eMail again?

          Cheers,
          Frank

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by ferdinand

            sorry,

            sdk_support(at)maxon(dot)net

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • fwilleke80F
              fwilleke80
              last edited by

              Hi Manuel,

              oh, of course. Thanks for the offer!
              Will send you a mail this week. Bit busy these days.

              Cheers,
              Frank

              www.frankwilleke.de
              Only asking personal code questions here.

              1 Reply Last reply Reply Quote 0
              • ManuelM
                Manuel
                last edited by

                Hi,
                Any news on that one ?

                Cheers,
                Manuel

                MAXON SDK Specialist

                MAXON Registered Developer

                1 Reply Last reply Reply Quote 0
                • fwilleke80F
                  fwilleke80
                  last edited by

                  Hi Manuel,

                  sorry, I totally forgot about this one. Priorities have changed, so this isn't an issue anymore at the moment.
                  Thanks!

                  Cheers,
                  Frank

                  www.frankwilleke.de
                  Only asking personal code questions here.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post