Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CoCreateInstance returns 0x80080005 from VS2008 ATL Service

288 views
Skip to first unread message

Roscoe

unread,
Mar 27, 2008, 12:46:00 PM3/27/08
to
I need some help.

I have a VS2005 attributed ATL Service that I am trying to migrate to VS2008
non-attributed ATL by creating a new project and moving the application code
over. The service contains a COM object that I obtain via a smart pointer
CreateInstance() call (VC++), or a "new someclass()" call (C#). The interface
is custom (IUnknown) and the proxy is registered correctly. Nothing too
advanced here. The VS2005 version works without a hitch. The VS2008 version
returns a 0x80080005 HRESULT
(CO_E_SERVER_EXEC_FAILURE) every time from both the C++ and C# client calls.
If I register the service as just a COM EXE I am able to obtain the object no
problem. The minute I register it as a service though, I always get the same
HRESULT error. I've tried everything I can imagine. I've opened up dcomcnfg
to just about everything. Ive tried running the service under my local
account. No luck. Something changed in VS2008. Any ideas?


The system event log shows:

The server {guid} did not register with DCOM within the required timeout.

C# returns:

Retrieving the COM class factory for component with CLSID {guid} failed due
to the following error: 80080005.

C++ basically reports that it is unable to create the object and returns
0x80080005 (very informative).

--
Roscoe

Brian Muth

unread,
Mar 27, 2008, 1:47:13 PM3/27/08
to

"Roscoe" <Ros...@newsgroup.nospam> wrote in message news:48229E4C-DBFD-48E6...@microsoft.com...

What are your DCOM settings? What is the identity of the service? Does the executable do any kind of GUI activity at all?

Roscoe

unread,
Mar 27, 2008, 4:40:01 PM3/27/08
to
Windows XP Pro development box

dcomcnfg:

Default Authentication Level: None
Default Impersonation Level: Impersonate

The service gets registered currently using default DCOM securities:

Default Launch Permission:

Administrators; Interactive; SYSTEM - all allowing local launch & activation

Default Access Permission:

SELF; SYSTEM - all allowing local Access

I'e tried adding NETWORK, INTERACTIVE, SERVICE, my account - same thing

Not sure what you are looking for on service indentity. Standard
non-attributed ATL service logging on to the Local System Account. As a test
I used the VS2008 ATL service wizard and the ATL Simple Object wizard to
create an out-of-the-box ATL service. One CoClass with an IUnknow interface.
All wizard produced. I get the same problem. Same DCOM settings and the
VS2005 service performs flawlessly. Don't register the VS2008 service as a
"\service", but only as a COM Exe and it works fine - this shows that the COM
plumbing is set up and working.

This service does not interact with the desktop.
--
Roscoe

Charles Wang[MSFT]

unread,
Mar 28, 2008, 5:12:12 AM3/28/08
to
Hi Roscoe,
I understand that when you tried to create an instance of the class from
your ATL COM service, you encountered the error 0x80080005.
If I have misunderstood, please let me know.

I once encountered this issue from a customer. He resolved this issue
finally by adding FORCEREMOVE to the ATL COM service .rgs file, from
something like:
HKCR
{
TestSvc.CTest.1 = s 'CTest Class'
{
CLSID = s
'{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33}'
}
TestSvc.CTest= s 'CTest Class'
{
CLSID = s
'{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33}'
CurVer = s ' TestSvc.CTest.1'
}
NoRemove CLSID
{
ForceRemove
{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33} = s 'CTest Class'
{
val AppID = s
'{D56EC23A-E95A-4C47-8483-1BE79E8929E9}'
'TypeLib' = s
'{4504FDBA-04E8-40CE-B94B-A12DECDF9AEC}'
ProgID = s 'TestSvc.CTest.1'
VersionIndependentProgID =
s 'TestSvc.CTest'
ForceRemove 'Programmable'

}
}
}
to the following:
HKCR
{
ForceRemove TestSvc.CTest.1 = s 'CTest Class'
{
CLSID = s
'{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33}'
}
ForceRemove TestSvc.CTest = s 'CTest Class'
{
CLSID = s
'{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33}'
CurVer = s 'TestSvc.CTest.1'
}
NoRemove CLSID
{
ForceRemove
{5D5DBB0A-EE2F-4AD2-BD52-E8A9F740EA33} = s 'CTest Class'
{
val AppID = s
'{D56EC23A-E95A-4C47-8483-1BE79E8929E9}'
'TypeLib' = s
'{4504FDBA-04E8-40CE-B94B-A12DECDF9AEC}'
ProgID = s 'TestSvc.CTest.1'
VersionIndependentProgID =
s 'TestSvc.CTest'
ForceRemove 'Programmable'

}
}
}

I recommend that you first try this method to see if it helps. If this
issue persists, is it possible for you to mail me
(changliw_at_microsoft_dot_com) a sample project so that I can reproduce
your issue and perform further research?

If you have any other questions or concerns, please feel free to let me
know. It is my pleasure to work with you for further research.

Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: msd...@microsoft.com.
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================


Jigar Mehta

unread,
May 7, 2008, 9:37:59 PM5/7/08
to
0 new messages