Article View: microsoft.public.vc.activextemplatelib
Article #7CoCreateInstance() returns E_FAIL (0x80004005) - HELP!!!
From: David Morgenlender
Date: Wed, 23 Sep 1998 00:00
Date: Wed, 23 Sep 1998 00:00
53 lines
2908 bytes
2908 bytes
I'm developing a inproc (DLL) server using VC++ 5. This had been working with dual interfaces. 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. 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'" BTW, 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:
<36163719.248954109@enews.newsguy.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<35f7af87.139502483@enews.newsguy.com> <35fca36a.74862657@enews.newsguy.com> <35fd93e5.9529171@enews.newsguy.com> <360a2925.226239187@enews.newsguy.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f9701,3495db342fe41c7b,start X-Google-Attributes: gidf9701,public X-Google-Thread: fc3fb,81ddca2bbfb6aa72 X-Google-Attributes: gidfc3fb,public X-Google-Thread: 108cda,81ddca2bbfb6aa72 X-Google-Attributes: gid108cda,public X-Google-Thread: fe15c,81ddca2bbfb6aa72 X-Google-Attributes: gidfe15c,public From: dmorgen@alum.mit.edu (David Morgenlender) Subject: CoCreateInstance() returns E_FAIL (0x80004005) - HELP!!! Date: 1998/09/23 Message-ID: <36163719.248954109@enews.newsguy.com> X-Deja-AN: 394095406 Content-Transfer-Encoding: 7bit References: <35f7af87.139502483@enews.newsguy.com> <35fca36a.74862657@enews.newsguy.com> <35fd93e5.9529171@enews.newsguy.com> <360a2925.226239187@enews.newsguy.com> Content-Type: text/plain; charset=us-ascii Organization: http://extra.newsguy.com Mime-Version: 1.0 Newsgroups: microsoft.public.vc.activextemplatelib,comp.os.ms-windows.programmer.ole,microsoft.public.win32.programmer.ole,borland.public.cppbuilder.activex