🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.vc.activextemplatelib
Article #8

How convert Dual Interface -> Custom Interface in ATL?

#8
From: David Morgenlender
Date: Wed, 23 Sep 1998 00:00
60 lines
2907 bytes
I'm developing a inproc (DLL) server using VC++ 5.  This had been working with
dual interfaces.  I recently changed the interfaces from dual to custom.
However, now the client cannont access the server interfaces.

Here's how I determined what to change when switching from dual interface to
custom interface:  I created 2 apps with the ATL Wizard, with the only
difference being the interface type.  I compared them.  I made the following
changes to my server, based upon the difference:

.IDL:

	Removed "object" & "dual" from each interface definition.
	Changed IDispatch to IUnknown for each interface definition.
	Removed the "id(n)" at the beginning of each method def.

ClassName.H:

	Changed each:
		"public IDispatchImpl<Interface Name>"
	    to:
		"public InterfaceName"

	Removed the following line:
		"COM_INTERFACE_ENTRY2( ... IDispatch ...)

ClassName.RGS:

	Removed the following line:
		"ForceRemove 'Progammable'"



Did I do this correctly?


Since I changed all interfaces to custom, I get the following HRESULT when
invoking CoCreateInstance() from a client, and *ppv is left as null:

	E_FAIL (0x80004005)

I've invoked CoCreateInstance() using both CLSCTX_SERVER & CLSCTX_INPROC_SERVER,
with the same results.

I only made the .RGS change after I had already encountered the error;  the
change made no difference.  I also tried using RegSvr32 to undefine the server.
In each case I rebuilt the app to insure the server was registered.  I check the
registry under ROOT to be sure the server is listed appropriately.

I traced through DllGetClassObject() on the server.  It returns without error &
with a non-null *ppv.

The app is being developed using Borland C++ Builder 3.  Everything is running
under Win95.

Any suggestions for what the problem may be, or how to debug this???

=======================================================
Dave Morgenlender
e-mail: dmorgen@alum.mit.edu
=======================================================
Technical Details
Message-ID: <361739ec.249676704@enews.newsguy.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108cda,7527133688a212ec,start
X-Google-Attributes: gid108cda,public
X-Google-Thread: f9701,7527133688a212ec,start
X-Google-Attributes: gidf9701,public
X-Google-Thread: fe15c,7527133688a212ec,start
X-Google-Attributes: gidfe15c,public
X-Google-Thread: fc3fb,7527133688a212ec,start
X-Google-Attributes: gidfc3fb,public
From: dmorgen@alum.mit.edu (David Morgenlender)
Subject: How convert Dual Interface -> Custom Interface in ATL?
Date: 1998/09/23
Message-ID: <361739ec.249676704@enews.newsguy.com>
X-Deja-AN: 394095407
Content-Transfer-Encoding: 7bit
Organization: http://extra.newsguy.com
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: microsoft.public.vc.activextemplatelib,comp.os.ms-windows.programmer.ole,microsoft.public.win32.programmer.ole,borland.public.cppbuilder.activex