Solved

passing memory into INPROC com objects

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now