467,911 Members | 1,376 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

Error creating COM component

I am trying to create an instance of a 3rd party COM component, and I'm
getting an error.

I've opened a ticket with this vendor as well, but I want to approach it
from the C# .NET side to make sure I'm not missing anything. I did recently
upgrade the product we are using to a newer version, I'm wondering if that
has anything to do. I did re-add the references to DOCSObjects however.

I try to create an instance of the object as follows,

DocAppObj = new Hummingbird.DM.Extensions.Interop.DOCSObjects.Appl ication();
Which produces this runtime error :
Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002.
System.InvalidCastException was unhandled
Message="Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002."
Source="MECTS3"
Any ideas?

Thanks,
Greg
Oct 25 '08 #1
  • viewed: 8374
Share:
4 Replies
Try to use this COM component from a VC++ application first...if it
works then proceed to .Net!
Also from VC++ first try to create the COM object by directly using
CoCreateInstance(Ex) then try going the IClassFactory way by calling
CoGetClassObject then calling the CreateInstance on the IClassFactory!

This way you will at-least be able to find out where the problem is.

Thanks & Regards,
Ashutosh

greg wrote:
I am trying to create an instance of a 3rd party COM component, and I'm
getting an error.

I've opened a ticket with this vendor as well, but I want to approach it
from the C# .NET side to make sure I'm not missing anything. I did recently
upgrade the product we are using to a newer version, I'm wondering if that
has anything to do. I did re-add the references to DOCSObjects however.

I try to create an instance of the object as follows,

DocAppObj = new Hummingbird.DM.Extensions.Interop.DOCSObjects.Appl ication();
Which produces this runtime error :
Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002.
System.InvalidCastException was unhandled
Message="Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002."
Source="MECTS3"
Any ideas?

Thanks,
Greg
Oct 26 '08 #2
80004002 is a generic error - Interface not supported....I didn't pay
attention to it before posting the last message!!! So, only you
component provider can help here!!!

greg wrote:
I am trying to create an instance of a 3rd party COM component, and I'm
getting an error.

I've opened a ticket with this vendor as well, but I want to approach it
from the C# .NET side to make sure I'm not missing anything. I did recently
upgrade the product we are using to a newer version, I'm wondering if that
has anything to do. I did re-add the references to DOCSObjects however.

I try to create an instance of the object as follows,

DocAppObj = new Hummingbird.DM.Extensions.Interop.DOCSObjects.Appl ication();
Which produces this runtime error :
Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002.
System.InvalidCastException was unhandled
Message="Creating an instance of the COM component with CLSID
{1CF0DE77-8CAE-11D1-82A2-0060083F9B01} from the IClassFactory failed due to
the following error: 80004002."
Source="MECTS3"
Any ideas?

Thanks,
Greg
Oct 26 '08 #3
Good morning Greg. Nice to see you again.

Apart from the possibility that the problem is caused by the component
vendor, (for example, they possibly did not handle the inheritance
relationship rightly or did not apply "Binary Compatibility" when releasing
the new version), another possible cause is related to "re-adding" the COM
component to our project. To double confirm that the error is not caused by
the .NET side, may I suggest re-adding the component based on the following
steps though I understand you already tried doing them:

1. Create a new C# project for test.
2. Add reference to the updated version of the COM component. Be sure that
the TypeLib version is new.
3. Call the code
DocAppObj = new Hummingbird.DM.Extensions.Interop.DOCSObjects.Appl ication();

If this test does not throw the error, I intend to think that the problem
is on the .NET side. You may want to do these steps to your real project:

1. Clean the project (Build menu -Clean <project>)
2. Remove all the references to the COM component and, the components that
were replied on if any, from the References node
3. Add the references again as we did in the above test project.

Best Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

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://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 27 '08 #4
Thanks. I created a new project, added the reference as you suggested, and
typed in just 2 lines of code to create the new instance of the object, it
gave the same error.

I will follow up with the vendor.

Thanks,
Greg

""Jialiang Ge [MSFT]"" wrote:
Good morning Greg. Nice to see you again.

Apart from the possibility that the problem is caused by the component
vendor, (for example, they possibly did not handle the inheritance
relationship rightly or did not apply "Binary Compatibility" when releasing
the new version), another possible cause is related to "re-adding" the COM
component to our project. To double confirm that the error is not caused by
the .NET side, may I suggest re-adding the component based on the following
steps though I understand you already tried doing them:

1. Create a new C# project for test.
2. Add reference to the updated version of the COM component. Be sure that
the TypeLib version is new.
3. Call the code
DocAppObj = new Hummingbird.DM.Extensions.Interop.DOCSObjects.Appl ication();

If this test does not throw the error, I intend to think that the problem
is on the .NET side. You may want to do these steps to your real project:

1. Clean the project (Build menu -Clean <project>)
2. Remove all the references to the COM component and, the components that
were replied on if any, from the References node
3. Add the references again as we did in the above test project.

Best Regards,
Jialiang Ge (ji****@online.microsoft.com, remove 'online.')
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:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

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://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tyler | last post: by
4 posts views Thread by John | last post: by
1 post views Thread by michaeltorus | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.