Solved

passing memory into INPROC com objects

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 55
maxBlock challenge 30 146
sum13 challenge 24 134
fix34  challenge 9 166
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

733 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