Link to home
Start Free TrialLog in
Avatar of Rashmin
Rashmin

asked on

Passing large object thru an interface...


How do i pass a large object from one ATL COM EXE to another( both developed in VC++ 5.0 ) on an interface.
The object is an instance of a huge class which has a lot of data in it and also pointers to many other classes.

Thanx in advance.
Rashmin
 
 
ASKER CERTIFIED SOLUTION
Avatar of vachooho
vachooho
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gelbert
gelbert

I would suggest not to pass your object around which involves problem of changing all pointers to interfaces.
  You should keep object where it is but pass it interface which client can query to get info, request action or get another interface. I think this is COM way of doing things
Avatar of Rashmin

ASKER

Hi vachooho
If this is the only way through, then it is bit difficult, since the object i am talking of is bit too large and contains pointers to a lot many classes and hence would not be possible to write a wrapper in COM for that.
Is there no other way of doing it?

Thanx

Rashmin
Avatar of Rashmin

ASKER

Hi gelbert

Is this the only way thru?
you can write your own marshaling code for that object but I think it will be much more difficult than splitting object into elementar pieces.
 Try to make several smaller objects out of your object(based on functionality, provided services). As result you should end up with container object whch aggregates number of other objects.
  I know it is kind of painful but it would easy your maintanence or allow more simple design changes (you know when project is almost done, then management would come up with "great" idea which has nothing to do with project design :) ).
  And it always easy to reuse smaller classes/COM objects and use components which you can plag/unplag without redoing a lot of code