Solved

passing memory into INPROC com objects

Posted on 2002-04-13
5
161 Views
Last Modified: 2013-11-20

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
Comment
Question by:Adept
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 6938683
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
 

Author Comment

by:Adept
ID: 6939931

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
 
LVL 32

Expert Comment

by:jhance
ID: 6940769
Hmmmm, "major errors", that really narrows things down...

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question