• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

passing memory into INPROC com objects


I have a COM object dll that needs to process extremely large amounts of data that come from an application (5 to 6megs at a time).  My question is, is there a way I can simply pass a pointer into the COM object and let it release the memory when its done or do I have to send the memory through the com interface in something like a massive safe array?
0
Adept
Asked:
Adept
  • 2
1 Solution
 
jhanceCommented:
With an in-process COM server you can certainly do this since both your client application and the COM server share the same memory space.  It's not a good technique, however, since it violates the structure of COM.

All data to/from COM should be passed via the COM interface.  Even a large block of data like you have can be done.  The VARIANT type supports arrays.

You may want to rethink your use of COM altogether if this is a big issue.
0
 
AdeptAuthor Commented:

when I instance memory in the app though and try to free it in the object I get major errors.  Is this supposed to happen?
0
 
jhanceCommented:
Hmmmm, "major errors", that really narrows things down...

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now