🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
2 messages
2 total messages Started by Jon Shemitz Thu, 26 Feb 1998 00:00
Have you built an out-of-process COM server with D3?
#336
Author: Jon Shemitz
Date: Thu, 26 Feb 1998 00:00
39 lines
2128 bytes
I've been having big troubles exporting objects across process
boundaries. I've posted about some of the problems I've run into, and
gotten mail/replies saying "gee, I wrote an in-process server, and
everything worked as documented". Has anyone had any luck writing an
out-of-process server?

The latest problem in a demo form:

I created a TComObject, with a "Class_NewComObj" GUID and an IPersist
interface. I can do the code below in an button-click handler on a form
in the server - but when I run it in a client in a different exe, the
"Assert(Assigned(Persist));" fails.

var
  Unknown:   IUnknown;
  Persist:   IPersist;
  ClsID:     TCLSID;
begin
  Unknown := CreateComObject(Class_NewComObj);
  Assert(Assigned(Unknown));

  Unknown.QueryInterface(IPersist, Persist);
  Assert(Assigned(Persist));

  Persist.GetClassID(ClsID);

I get similar results when I use a class factory - I can get an
IUnknown, but not an IPersist. I've put ShowMessage statements into the
object's Initialize and Destroy routines, so I know that
CreateComObject() is creating the right object, it's 'just' that
QueryInterface() doesn't seem to be working properly across process
boundaries.


-- 

http://www.midnightbeach.com - for info about me, my work, my writing,
                               and my homeschool resource pages.
Re: Have you built an out-of-process COM server with D3?
#337
Author: Jon Shemitz
Date: Fri, 27 Feb 1998 00:00
15 lines
1352 bytes
I wrote:
 
> I've been having big troubles exporting objects across process
> boundaries. I've posted about some of the problems I've run into, and
> gotten mail/replies saying "gee, I wrote an in-process server, and
> everything worked as documented". Has anyone had any luck writing an
> out-of-process server?

Mea culpa. I had a trashed registry - bad GUID's for the proxy handlers.

-- 

http://www.midnightbeach.com - for info about me, my work, my writing,
                               and my homeschool resource pages.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads