Article View: comp.lang.pascal.delphi.misc
Article #336Have you built an out-of-process COM server with D3?
From: Jon Shemitz
Date: Thu, 26 Feb 1998 00:00
Date: Thu, 26 Feb 1998 00:00
39 lines
2128 bytes
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.
Technical Details
Message-ID:
<34F5F14E.668A3699@midnightbeach.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10baee,575b33cdc6f641d8,start X-Google-Attributes: gid10baee,public X-Google-Thread: 1043cf,575b33cdc6f641d8,start X-Google-Attributes: gid1043cf,public X-Google-Thread: fd196,575b33cdc6f641d8,start X-Google-Attributes: gidfd196,public From: Jon Shemitz <jon@midnightbeach.com> Subject: Have you built an out-of-process COM server with D3? Date: 1998/02/26 Message-ID: <34F5F14E.668A3699@midnightbeach.com> X-Deja-AN: 329016942 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Organization: Midnight Beach Mime-Version: 1.0 Reply-To: jon@midnightbeach.com Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.objectpascal,borland.public.delphi.oleautomation