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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Passing large data to DLLs

Passing large data to DLLs

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • U Offline
    U Offline
    User 653255
    wrote on last edited by
    #1

    Hi all, I need to pass large data( in the order of MBs ) to DLL for processing. When I pass a reference to such object that holds reference to this data from the application and then, trying to access the member variables from passed object causes crash my application. Note that, it works fine if 1. I downsize data in object, 2. I make member variables public. Is there any thing special I need to do when passing and processing large data to DLL? Hope I am clear about the question. Please feel free to ask any questions, that would help to understand problem more correctly. Thanks and regards, Shrinivas

    A M D 3 Replies Last reply
    0
    • U User 653255

      Hi all, I need to pass large data( in the order of MBs ) to DLL for processing. When I pass a reference to such object that holds reference to this data from the application and then, trying to access the member variables from passed object causes crash my application. Note that, it works fine if 1. I downsize data in object, 2. I make member variables public. Is there any thing special I need to do when passing and processing large data to DLL? Hope I am clear about the question. Please feel free to ask any questions, that would help to understand problem more correctly. Thanks and regards, Shrinivas

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      1. how many MBs? 2. is this data local memory? Don't try it, just do it! ;-)

      1 Reply Last reply
      0
      • U User 653255

        Hi all, I need to pass large data( in the order of MBs ) to DLL for processing. When I pass a reference to such object that holds reference to this data from the application and then, trying to access the member variables from passed object causes crash my application. Note that, it works fine if 1. I downsize data in object, 2. I make member variables public. Is there any thing special I need to do when passing and processing large data to DLL? Hope I am clear about the question. Please feel free to ask any questions, that would help to understand problem more correctly. Thanks and regards, Shrinivas

        M Offline
        M Offline
        melwyn
        wrote on last edited by
        #3

        How about using shared memory? -Mel

        1 Reply Last reply
        0
        • U User 653255

          Hi all, I need to pass large data( in the order of MBs ) to DLL for processing. When I pass a reference to such object that holds reference to this data from the application and then, trying to access the member variables from passed object causes crash my application. Note that, it works fine if 1. I downsize data in object, 2. I make member variables public. Is there any thing special I need to do when passing and processing large data to DLL? Hope I am clear about the question. Please feel free to ask any questions, that would help to understand problem more correctly. Thanks and regards, Shrinivas

          D Offline
          D Offline
          Dimitris Vasiliadis
          wrote on last edited by
          #4

          If you have access to the dll sources, you can try changing the dll to export two functions - Func1 to load (and append) the data, and Func2 will process the loaded data. Then break your data into smaller blocks and call Func1 until all data is loaded, then call Func2 to handle them.


          ...Plug & Pray... X|

          U 1 Reply Last reply
          0
          • D Dimitris Vasiliadis

            If you have access to the dll sources, you can try changing the dll to export two functions - Func1 to load (and append) the data, and Func2 will process the loaded data. Then break your data into smaller blocks and call Func1 until all data is loaded, then call Func2 to handle them.


            ...Plug & Pray... X|

            U Offline
            U Offline
            User 653255
            wrote on last edited by
            #5

            call Func1 until all data is loaded, then call Func2 to handle them .... Does this mean that, I am trying to access the data before it is loaded? I am not sure what we mean "Data loaded" here. This may sound primitive question. But I will appreciate further explanation. Thanks and regards, Shrinivas

            D 1 Reply Last reply
            0
            • U User 653255

              call Func1 until all data is loaded, then call Func2 to handle them .... Does this mean that, I am trying to access the data before it is loaded? I am not sure what we mean "Data loaded" here. This may sound primitive question. But I will appreciate further explanation. Thanks and regards, Shrinivas

              D Offline
              D Offline
              Dimitris Vasiliadis
              wrote on last edited by
              #6

              I think the problem is on passing large amounts of data as parameters. Since you say it works with smaller blocks, what I suggest is break the large data into smaller blocks and call Func1 to pass them to the dll one by one. Finally when you have passed all the smaller blocks to the dll, call Func2 to process them all together as one.

              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