Board index » delphi » Out of proc server passing InProc server interfaces??

Out of proc server passing InProc server interfaces??

I have an out of process server which passes to the client, interfaces
implemented in an in process server.

When doing a query interface on objects from the inProcess server from the
client, I get an OLE "member not found" error.  Yet when I assign the
interface to an OLEVariant and access the interfaces member functions, there
are no errors and everything works as it should.  If I change the server to
an in process server, the QueryInterface works fine.

My assumption is that the object interfaces implemented in the inprocess
server are not being marshalled properly across the process boundry to the
client.  Is there a way to have these objects marshalled properly or do I
have to drop this design and go with all inproc servers or all out of proc
servers.

 

Re:Out of proc server passing InProc server interfaces??


Marshaling should work if either:

1) Your interfaces (I mean all interfaces that you export out) are defined
in a type library with at least the [oleautomation] flag set. And the type
library is registered.

2) You have a proxy-stub dll registered that contains marshaling information
of your interfaces.

I've never gotten a "member not found" error on a QI call so I'm not sure if
that error is originating from QI or from an earlier error that you probably
didn't catch. If marshaling doesn't work, you should get something like an
"interface not supported" error.

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
Ken Friesen <k...@interlinq.com.nospam> wrote in message

news:7srg3d$b0u10@forums.borland.com...
Quote
> I have an out of process server which passes to the client, interfaces
> implemented in an in process server.

> When doing a query interface on objects from the inProcess server from the
> client, I get an OLE "member not found" error.  Yet when I assign the
> interface to an OLEVariant and access the interfaces member functions,
there
> are no errors and everything works as it should.  If I change the server
to
> an in process server, the QueryInterface works fine.

> My assumption is that the object interfaces implemented in the inprocess
> server are not being marshalled properly across the process boundry to the
> client.  Is there a way to have these objects marshalled properly or do I
> have to drop this design and go with all inproc servers or all out of proc
> servers.

Re:Out of proc server passing InProc server interfaces??


Perhaps it is not a marshalling problem then ...  I cannot for the life of
me understand why I can call members of  an interface through invoke (with
delphi's default variant handling) yet I cannot find the interface itself
through QueryInterface??  Any ideas on this?

The type libraries are registered with the oleautomation flag set.  I'm not
sure what I have to do with regard to the proxy stub dll - I thought this
was handled automatically through com/delphi.

Thanks!

Quote
Binh Ly <b...@castle.net> wrote in message

news:7srpqm$ehk8@forums.borland.com...
Quote
> Marshaling should work if either:

> 1) Your interfaces (I mean all interfaces that you export out) are defined
> in a type library with at least the [oleautomation] flag set. And the type
> library is registered.

> 2) You have a proxy-stub dll registered that contains marshaling
information
> of your interfaces.

> I've never gotten a "member not found" error on a QI call so I'm not sure
if
> that error is originating from QI or from an earlier error that you
probably
> didn't catch. If marshaling doesn't work, you should get something like an
> "interface not supported" error.

> have fun
> --
> Binh Ly
> Visit my COM Notes at http://www.castle.net/~bly/com

> Ken Friesen <k...@interlinq.com.nospam> wrote in message
> news:7srg3d$b0u10@forums.borland.com...
> > I have an out of process server which passes to the client, interfaces
> > implemented in an in process server.

> > When doing a query interface on objects from the inProcess server from
the
> > client, I get an OLE "member not found" error.  Yet when I assign the
> > interface to an OLEVariant and access the interfaces member functions,
> there
> > are no errors and everything works as it should.  If I change the server
> to
> > an in process server, the QueryInterface works fine.

> > My assumption is that the object interfaces implemented in the inprocess
> > server are not being marshalled properly across the process boundry to
the
> > client.  Is there a way to have these objects marshalled properly or do
I
> > have to drop this design and go with all inproc servers or all out of
proc
> > servers.

Re:Out of proc server passing InProc server interfaces??


Ken,

If you are using a typelibrary for both servers (inproc/outproc) then
marshaling should be installed per se.  Passing the interface pointer from
the inproc to the outproc, if done correctly will instantiate the necessary
proxy/stub marshalers, whether it is the universal marshaler or some other
interface marshalers.

You do not need to consider proxy/stub writing if you do not wish - by
providing the type library and setting the oleautomation flag, you will use
universal marshaling and you need not concern yourself with proxy/stub
writing.  Since the inteface works in one instance and not the other may
mean the marshaling used isn't ascertained properly by the COM subsystem.
Check your registry underneath HKCR\Interface and locate the interface ID
you are trying to ask in the QI.  It should look like this:

HKCR\Interface\
    <Your interface GUID>\
        ProxyStubClsid\
        ProxyStubClsid32\
            default = {00020424-0000-0000-C000-000000000046} // The
universal marshaler
        TypeLib\
            default = Library GUID for the typelibrary
            Version = 1.0

Check that this is sorted as it will help confirm that atleast the interface
can be located properly.

Nick.

Quote
Ken Friesen <k...@interlinq.com.nospam> wrote in message

news:7sruje$ehi9@forums.borland.com...
Quote
> Perhaps it is not a marshalling problem then ...  I cannot for the life of
> me understand why I can call members of  an interface through invoke (with
> delphi's default variant handling) yet I cannot find the interface itself
> through QueryInterface??  Any ideas on this?

> The type libraries are registered with the oleautomation flag set.  I'm
not
> sure what I have to do with regard to the proxy stub dll - I thought this
> was handled automatically through com/delphi.

> Thanks!

> Binh Ly <b...@castle.net> wrote in message
> news:7srpqm$ehk8@forums.borland.com...
> > Marshaling should work if either:

> > 1) Your interfaces (I mean all interfaces that you export out) are
defined
> > in a type library with at least the [oleautomation] flag set. And the
type
> > library is registered.

> > 2) You have a proxy-stub dll registered that contains marshaling
> information
> > of your interfaces.

> > I've never gotten a "member not found" error on a QI call so I'm not
sure
> if
> > that error is originating from QI or from an earlier error that you
> probably
> > didn't catch. If marshaling doesn't work, you should get something like
an
> > "interface not supported" error.

> > have fun
> > --
> > Binh Ly
> > Visit my COM Notes at http://www.castle.net/~bly/com

> > Ken Friesen <k...@interlinq.com.nospam> wrote in message
> > news:7srg3d$b0u10@forums.borland.com...
> > > I have an out of process server which passes to the client, interfaces
> > > implemented in an in process server.

> > > When doing a query interface on objects from the inProcess server from
> the
> > > client, I get an OLE "member not found" error.  Yet when I assign the
> > > interface to an OLEVariant and access the interfaces member functions,
> > there
> > > are no errors and everything works as it should.  If I change the
server
> > to
> > > an in process server, the QueryInterface works fine.

> > > My assumption is that the object interfaces implemented in the
inprocess
> > > server are not being marshalled properly across the process boundry to
> the
> > > client.  Is there a way to have these objects marshalled properly or
do
> I
> > > have to drop this design and go with all inproc servers or all out of
> proc
> > > servers.

Re:Out of proc server passing InProc server interfaces??


Thanks Nick!

That lead me in the right direction.  I had split up a type library into two
type libraries and just cutting and pasting the idl.  I forgot to give the
new type library a new GUID, thus all my problems.

Thanks again.

Ken

Quote
Nicholas Robinson <NicholasRobin...@yahoo.co.uk> wrote in message

news:7ssjrf$ja716@forums.borland.com...
Quote
> Ken,

> If you are using a typelibrary for both servers (inproc/outproc) then
> marshaling should be installed per se.  Passing the interface pointer from
> the inproc to the outproc, if done correctly will instantiate the
necessary
> proxy/stub marshalers, whether it is the universal marshaler or some other
> interface marshalers.

> You do not need to consider proxy/stub writing if you do not wish - by
> providing the type library and setting the oleautomation flag, you will
use
> universal marshaling and you need not concern yourself with proxy/stub
> writing.  Since the inteface works in one instance and not the other may
> mean the marshaling used isn't ascertained properly by the COM subsystem.
> Check your registry underneath HKCR\Interface and locate the interface ID
> you are trying to ask in the QI.  It should look like this:

> HKCR\Interface\
>     <Your interface GUID>\
>         ProxyStubClsid\
>         ProxyStubClsid32\
>             default = {00020424-0000-0000-C000-000000000046} // The
> universal marshaler
>         TypeLib\
>             default = Library GUID for the typelibrary
>             Version = 1.0

> Check that this is sorted as it will help confirm that atleast the
interface
> can be located properly.

> Nick.

> Ken Friesen <k...@interlinq.com.nospam> wrote in message
> news:7sruje$ehi9@forums.borland.com...
> > Perhaps it is not a marshalling problem then ...  I cannot for the life
of
> > me understand why I can call members of  an interface through invoke
(with
> > delphi's default variant handling) yet I cannot find the interface
itself
> > through QueryInterface??  Any ideas on this?

> > The type libraries are registered with the oleautomation flag set.  I'm
> not
> > sure what I have to do with regard to the proxy stub dll - I thought
this
> > was handled automatically through com/delphi.

> > Thanks!

> > Binh Ly <b...@castle.net> wrote in message
> > news:7srpqm$ehk8@forums.borland.com...
> > > Marshaling should work if either:

> > > 1) Your interfaces (I mean all interfaces that you export out) are
> defined
> > > in a type library with at least the [oleautomation] flag set. And the
> type
> > > library is registered.

> > > 2) You have a proxy-stub dll registered that contains marshaling
> > information
> > > of your interfaces.

> > > I've never gotten a "member not found" error on a QI call so I'm not
> sure
> > if
> > > that error is originating from QI or from an earlier error that you
> > probably
> > > didn't catch. If marshaling doesn't work, you should get something
like
> an
> > > "interface not supported" error.

> > > have fun
> > > --
> > > Binh Ly
> > > Visit my COM Notes at http://www.castle.net/~bly/com

> > > Ken Friesen <k...@interlinq.com.nospam> wrote in message
> > > news:7srg3d$b0u10@forums.borland.com...
> > > > I have an out of process server which passes to the client,
interfaces
> > > > implemented in an in process server.

> > > > When doing a query interface on objects from the inProcess server
from
> > the
> > > > client, I get an OLE "member not found" error.  Yet when I assign
the
> > > > interface to an OLEVariant and access the interfaces member
functions,
> > > there
> > > > are no errors and everything works as it should.  If I change the
> server
> > > to
> > > > an in process server, the QueryInterface works fine.

> > > > My assumption is that the object interfaces implemented in the
> inprocess
> > > > server are not being marshalled properly across the process boundry
to
> > the
> > > > client.  Is there a way to have these objects marshalled properly or
> do
> > I
> > > > have to drop this design and go with all inproc servers or all out
of
> > proc
> > > > servers.

Re:Out of proc server passing InProc server interfaces??


<g> Glad you got it sorted.

Nick.

Quote
Ken Friesen <k...@interlinq.com.nospam> wrote in message

news:7sth92$5l4@forums.borland.com...
Quote
> Thanks Nick!

> That lead me in the right direction.  I had split up a type library into
two
> type libraries and just cutting and pasting the idl.  I forgot to give the
> new type library a new GUID, thus all my problems.

> Thanks again.

> Ken

> Nicholas Robinson <NicholasRobin...@yahoo.co.uk> wrote in message
> news:7ssjrf$ja716@forums.borland.com...
> > Ken,

> > If you are using a typelibrary for both servers (inproc/outproc) then
> > marshaling should be installed per se.  Passing the interface pointer
from
> > the inproc to the outproc, if done correctly will instantiate the
> necessary
> > proxy/stub marshalers, whether it is the universal marshaler or some
other
> > interface marshalers.

> > You do not need to consider proxy/stub writing if you do not wish - by
> > providing the type library and setting the oleautomation flag, you will
> use
> > universal marshaling and you need not concern yourself with proxy/stub
> > writing.  Since the inteface works in one instance and not the other may
> > mean the marshaling used isn't ascertained properly by the COM
subsystem.
> > Check your registry underneath HKCR\Interface and locate the interface
ID
> > you are trying to ask in the QI.  It should look like this:

> > HKCR\Interface\
> >     <Your interface GUID>\
> >         ProxyStubClsid\
> >         ProxyStubClsid32\
> >             default = {00020424-0000-0000-C000-000000000046} // The
> > universal marshaler
> >         TypeLib\
> >             default = Library GUID for the typelibrary
> >             Version = 1.0

> > Check that this is sorted as it will help confirm that atleast the
> interface
> > can be located properly.

> > Nick.

> > Ken Friesen <k...@interlinq.com.nospam> wrote in message
> > news:7sruje$ehi9@forums.borland.com...
> > > Perhaps it is not a marshalling problem then ...  I cannot for the
life
> of
> > > me understand why I can call members of  an interface through invoke
> (with
> > > delphi's default variant handling) yet I cannot find the interface
> itself
> > > through QueryInterface??  Any ideas on this?

> > > The type libraries are registered with the oleautomation flag set.
I'm
> > not
> > > sure what I have to do with regard to the proxy stub dll - I thought
> this
> > > was handled automatically through com/delphi.

> > > Thanks!

> > > Binh Ly <b...@castle.net> wrote in message
> > > news:7srpqm$ehk8@forums.borland.com...
> > > > Marshaling should work if either:

> > > > 1) Your interfaces (I mean all interfaces that you export out) are
> > defined
> > > > in a type library with at least the [oleautomation] flag set. And
the
> > type
> > > > library is registered.

> > > > 2) You have a proxy-stub dll registered that contains marshaling
> > > information
> > > > of your interfaces.

> > > > I've never gotten a "member not found" error on a QI call so I'm not
> > sure
> > > if
> > > > that error is originating from QI or from an earlier error that you
> > > probably
> > > > didn't catch. If marshaling doesn't work, you should get something
> like
> > an
> > > > "interface not supported" error.

> > > > have fun
> > > > --
> > > > Binh Ly
> > > > Visit my COM Notes at http://www.castle.net/~bly/com

> > > > Ken Friesen <k...@interlinq.com.nospam> wrote in message
> > > > news:7srg3d$b0u10@forums.borland.com...
> > > > > I have an out of process server which passes to the client,
> interfaces
> > > > > implemented in an in process server.

> > > > > When doing a query interface on objects from the inProcess server
> from
> > > the
> > > > > client, I get an OLE "member not found" error.  Yet when I assign
> the
> > > > > interface to an OLEVariant and access the interfaces member
> functions,
> > > > there
> > > > > are no errors and everything works as it should.  If I change the
> > server
> > > > to
> > > > > an in process server, the QueryInterface works fine.

> > > > > My assumption is that the object interfaces implemented in the
> > inprocess
> > > > > server are not being marshalled properly across the process
boundry
> to
> > > the
> > > > > client.  Is there a way to have these objects marshalled properly
or
> > do
> > > I
> > > > > have to drop this design and go with all inproc servers or all out
> of
> > > proc
> > > > > servers.

Other Threads