Solved

passing memory into INPROC com objects

Posted on 2002-04-13
5
159 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
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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 …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

860 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