IPicture across process boundaries 
Author Message
 IPicture across process boundaries

Hello

    ATL out of proc server (EXE) that needs to get IPicture objects and
display it. right now I'm getting problem passing this interface across
process boundaries. is there a way to overcome this problem?

thanks in advance
Yoramo.



Sun, 11 Dec 2005 16:15:41 GMT  
 IPicture across process boundaries
MSDN
[q]
The picture object also supports IPersistStream so it can save and load
itself from an instance of IStream. An object that uses a picture object
internally would normally save and load the picture as part of the object's
own persistence handling. The function OleLoadPicture simplifies the
creation of a picture object based on stream contents.
[/q]
So, just use IStream to pass IPicture data.

--
Sorry for bad English.


Quote:
> Hello

>     ATL out of proc server (EXE) that needs to get IPicture objects and
> display it. right now I'm getting problem passing this interface across
> process boundaries. is there a way to overcome this problem?

> thanks in advance
> Yoramo.



Sun, 11 Dec 2005 15:36:39 GMT  
 IPicture across process boundaries
I do not want to serialize the IPicture, I was thinking more about
marshaling.


Quote:
> MSDN
> [q]
> The picture object also supports IPersistStream so it can save and load
> itself from an instance of IStream. An object that uses a picture object
> internally would normally save and load the picture as part of the
object's
> own persistence handling. The function OleLoadPicture simplifies the
> creation of a picture object based on stream contents.
> [/q]
> So, just use IStream to pass IPicture data.

> --
> Sorry for bad English.



> > Hello

> >     ATL out of proc server (EXE) that needs to get IPicture objects and
> > display it. right now I'm getting problem passing this interface across
> > process boundaries. is there a way to overcome this problem?

> > thanks in advance
> > Yoramo.



Sun, 11 Dec 2005 19:00:02 GMT  
 IPicture across process boundaries

Quote:
> I do not want to serialize the IPicture, I was thinking more about
> marshaling.

You are sadly out of luck. See KB Article Q150034 "PRB: LPPICTUREDISP
Cannot Be Passed Across Process Boundaries"
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Mon, 12 Dec 2005 00:42:11 GMT  
 IPicture across process boundaries
Once you have the stream, what prevents you from accessing the
underlying data buffer and sending it over the wire? You can then
construct another IStream at the receiver and create a picture
from it.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I do not want to serialize the IPicture, I was thinking more about
> marshaling.



> > MSDN
> > [q]
> > The picture object also supports IPersistStream so it can save and load
> > itself from an instance of IStream. An object that uses a picture object
> > internally would normally save and load the picture as part of the
> object's
> > own persistence handling. The function OleLoadPicture simplifies the
> > creation of a picture object based on stream contents.
> > [/q]
> > So, just use IStream to pass IPicture data.

> > --
> > Sorry for bad English.



> > > Hello

> > >     ATL out of proc server (EXE) that needs to get IPicture objects and
> > > display it. right now I'm getting problem passing this interface across
> > > process boundaries. is there a way to overcome this problem?

> > > thanks in advance
> > > Yoramo.



Mon, 12 Dec 2005 02:01:58 GMT  
 IPicture across process boundaries
I'm not present in both sides of the COM. I'm giving interfaces that can be
implemented/used by third party. so I need to be able to pass the data as
simple as posible.

yoramo


Once you have the stream, what prevents you from accessing the
underlying data buffer and sending it over the wire? You can then
construct another IStream at the receiver and create a picture
from it.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I do not want to serialize the IPicture, I was thinking more about
> marshaling.



> > MSDN
> > [q]
> > The picture object also supports IPersistStream so it can save and load
> > itself from an instance of IStream. An object that uses a picture object
> > internally would normally save and load the picture as part of the
> object's
> > own persistence handling. The function OleLoadPicture simplifies the
> > creation of a picture object based on stream contents.
> > [/q]
> > So, just use IStream to pass IPicture data.

> > --
> > Sorry for bad English.



> > > Hello

> > >     ATL out of proc server (EXE) that needs to get IPicture objects
and
> > > display it. right now I'm getting problem passing this interface
across
> > > process boundaries. is there a way to overcome this problem?

> > > thanks in advance
> > > Yoramo.



Tue, 13 Dec 2005 05:01:33 GMT  
 IPicture across process boundaries
I was afraid of it.

thanks.
Yoramo


Quote:


> > I do not want to serialize the IPicture, I was thinking more about
> > marshaling.

> You are sadly out of luck. See KB Article Q150034 "PRB: LPPICTUREDISP
> Cannot Be Passed Across Process Boundaries"
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



Tue, 13 Dec 2005 05:02:50 GMT  
 IPicture across process boundaries
You do that in the interface marshaling code, which is ultimately
hidden from any client - it's in the proxy/stub DLL. For example
you can use a local/call_as pair of methods.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I'm not present in both sides of the COM. I'm giving interfaces that can be
> implemented/used by third party. so I need to be able to pass the data as
> simple as posible.

> yoramo



> Once you have the stream, what prevents you from accessing the
> underlying data buffer and sending it over the wire? You can then
> construct another IStream at the receiver and create a picture
> from it.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > I do not want to serialize the IPicture, I was thinking more about
> > marshaling.



> > > MSDN
> > > [q]
> > > The picture object also supports IPersistStream so it can save and load
> > > itself from an instance of IStream. An object that uses a picture object
> > > internally would normally save and load the picture as part of the
> > object's
> > > own persistence handling. The function OleLoadPicture simplifies the
> > > creation of a picture object based on stream contents.
> > > [/q]
> > > So, just use IStream to pass IPicture data.

> > > --
> > > Sorry for bad English.



> > > > Hello

> > > >     ATL out of proc server (EXE) that needs to get IPicture objects
> and
> > > > display it. right now I'm getting problem passing this interface
> across
> > > > process boundaries. is there a way to overcome this problem?

> > > > thanks in advance
> > > > Yoramo.



Tue, 13 Dec 2005 06:30:25 GMT  
 IPicture across process boundaries
I do not have a proxy/stub DLL I'm using the automation marshaling. can I
implement a proxy/stub DLL only for part of the methods? where can I find an
example?

thanks
Yoramo


You do that in the interface marshaling code, which is ultimately
hidden from any client - it's in the proxy/stub DLL. For example
you can use a local/call_as pair of methods.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I'm not present in both sides of the COM. I'm giving interfaces that can
be
> implemented/used by third party. so I need to be able to pass the data as
> simple as posible.

> yoramo



> Once you have the stream, what prevents you from accessing the
> underlying data buffer and sending it over the wire? You can then
> construct another IStream at the receiver and create a picture
> from it.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > I do not want to serialize the IPicture, I was thinking more about
> > marshaling.



> > > MSDN
> > > [q]
> > > The picture object also supports IPersistStream so it can save and
load
> > > itself from an instance of IStream. An object that uses a picture
object
> > > internally would normally save and load the picture as part of the
> > object's
> > > own persistence handling. The function OleLoadPicture simplifies the
> > > creation of a picture object based on stream contents.
> > > [/q]
> > > So, just use IStream to pass IPicture data.

> > > --
> > > Sorry for bad English.



> > > > Hello

> > > >     ATL out of proc server (EXE) that needs to get IPicture objects
> and
> > > > display it. right now I'm getting problem passing this interface
> across
> > > > process boundaries. is there a way to overcome this problem?

> > > > thanks in advance
> > > > Yoramo.



Tue, 13 Dec 2005 08:13:08 GMT  
 IPicture across process boundaries

Quote:
> I do not have a proxy/stub DLL I'm using the automation marshaling. can I
> implement a proxy/stub DLL only for part of the methods? where can I find
an
> example?

I don't think so.
If you use typelib-marshaling i don't see any problems. All interface
pointers and automation-comatible data marshaling automaticly.

[]

--
Sorry for bad English.



Tue, 13 Dec 2005 13:18:20 GMT  
 IPicture across process boundaries

Quote:


> > I do not have a proxy/stub DLL I'm using the automation marshaling.
can I
> > implement a proxy/stub DLL only for part of the methods? where can I
find
> an
> > example?

> I don't think so.
> If you use typelib-marshaling i don't see any problems. All interface
> pointers and automation-comatible data marshaling automaticly.

Except that IPictureDisp simply does not work properly when marshalled,
even though all calls succeed. IPictureDisp passes around GDI handles
cast as long, but of course a handle valid in one process is not valid
in another. You call the method and get the handle value all right, but
you can't do anything useful with it.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken



Tue, 13 Dec 2005 23:25:47 GMT  
 IPicture across process boundaries
You must not use an Automation interface to start with. Then you
can use a local/call_as pair of methods and write the marshaling
code for the bridge between them (the proxy/stub DLL won't link
without your code). See the MIDL pages on [local] and [call_as].
Alternatively, you can use custom marshaling... (e.g. implement
IMarshal on your object)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I do not have a proxy/stub DLL I'm using the automation marshaling. can I
> implement a proxy/stub DLL only for part of the methods? where can I find an
> example?

> thanks
> Yoramo



> You do that in the interface marshaling code, which is ultimately
> hidden from any client - it's in the proxy/stub DLL. For example
> you can use a local/call_as pair of methods.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > I'm not present in both sides of the COM. I'm giving interfaces that can
> be
> > implemented/used by third party. so I need to be able to pass the data as
> > simple as posible.

> > yoramo



> > Once you have the stream, what prevents you from accessing the
> > underlying data buffer and sending it over the wire? You can then
> > construct another IStream at the receiver and create a picture
> > from it.

> > --
> > =====================================
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD

> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =====================================



> > > I do not want to serialize the IPicture, I was thinking more about
> > > marshaling.



> > > > MSDN
> > > > [q]
> > > > The picture object also supports IPersistStream so it can save and
> load
> > > > itself from an instance of IStream. An object that uses a picture
> object
> > > > internally would normally save and load the picture as part of the
> > > object's
> > > > own persistence handling. The function OleLoadPicture simplifies the
> > > > creation of a picture object based on stream contents.
> > > > [/q]
> > > > So, just use IStream to pass IPicture data.

> > > > --
> > > > Sorry for bad English.



> > > > > Hello

> > > > >     ATL out of proc server (EXE) that needs to get IPicture objects
> > and
> > > > > display it. right now I'm getting problem passing this interface
> > across
> > > > > process boundaries. is there a way to overcome this problem?

> > > > > thanks in advance
> > > > > Yoramo.



Wed, 14 Dec 2005 01:21:50 GMT  
 IPicture across process boundaries
thanks this is what I was looking for, I will look into it to see if it fits
my need.

Thanks
Yoramo


You must not use an Automation interface to start with. Then you
can use a local/call_as pair of methods and write the marshaling
code for the bridge between them (the proxy/stub DLL won't link
without your code). See the MIDL pages on [local] and [call_as].
Alternatively, you can use custom marshaling... (e.g. implement
IMarshal on your object)

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I do not have a proxy/stub DLL I'm using the automation marshaling. can I
> implement a proxy/stub DLL only for part of the methods? where can I find
an
> example?

> thanks
> Yoramo



> You do that in the interface marshaling code, which is ultimately
> hidden from any client - it's in the proxy/stub DLL. For example
> you can use a local/call_as pair of methods.

> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================



> > I'm not present in both sides of the COM. I'm giving interfaces that can
> be
> > implemented/used by third party. so I need to be able to pass the data
as
> > simple as posible.

> > yoramo



> > Once you have the stream, what prevents you from accessing the
> > underlying data buffer and sending it over the wire? You can then
> > construct another IStream at the receiver and create a picture
> > from it.

> > --
> > =====================================
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD

> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =====================================



> > > I do not want to serialize the IPicture, I was thinking more about
> > > marshaling.



> > > > MSDN
> > > > [q]
> > > > The picture object also supports IPersistStream so it can save and
> load
> > > > itself from an instance of IStream. An object that uses a picture
> object
> > > > internally would normally save and load the picture as part of the
> > > object's
> > > > own persistence handling. The function OleLoadPicture simplifies the
> > > > creation of a picture object based on stream contents.
> > > > [/q]
> > > > So, just use IStream to pass IPicture data.

> > > > --
> > > > Sorry for bad English.



> > > > > Hello

> > > > >     ATL out of proc server (EXE) that needs to get IPicture
objects
> > and
> > > > > display it. right now I'm getting problem passing this interface
> > across
> > > > > process boundaries. is there a way to overcome this problem?

> > > > > thanks in advance
> > > > > Yoramo.



Thu, 15 Dec 2005 08:26:55 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Throwing com exceptions across process boundaries...

2. IXMLDOMNodeList across process boundaries?

3. Connection Point Events Across Processes Boundaries?

4. Can't pass IIDs properly across process boundaries

5. Passing Socket handles across process boundaries??

6. Can't pass IIDs properly across process boundaries

7. _com_error thrown across machine boundaries

8. Exceptions Across DLL Boundaries?

9. inheritance across dll boundaries

10. STL and string memory allocation across a DLL boundary

11. C# as converter across Assembly boundaries

12. Re : Interface pointers over process boundaries

 

 
Powered by phpBB® Forum Software