Last post Apr 16, 2008 10:43 AM by Davedavex
Apr 12, 2008 11:55 PM|Davedavex|LINK
Hi, I am recently working on a .net 2.0 win form application which calls an IBM Personal Communications com object. It works perfectly fine. Then when I tried to call the same object in a windows service. it gives me this exception 'Unable
to cast COM object of type xxxxx to interface type xxxxx, This operation failed because the QueryInterface call on the COM component for the interface with IID ...'. I have tried different windows service logon account with no luck. I am not an experienced
COM developer. Can anyone please give me a clue what happened? Thanks.
Apr 13, 2008 11:27 AM|albertpascual|LINK
Did you compile the DLL for COM?
Apr 13, 2008 07:38 PM|Davedavex|LINK
Thanks for replying Al. I am not quite sure if I have compiled it for COM. but I have IBM personal communications installed on my computer, which also installed some com objects that I can reference in my .net application. so when I reference those com objects, some
interop_xxxx.dll are copied to my bin folder, then I use them directly in my code. does that mean those com objects are compiled ok?
Apr 14, 2008 05:21 AM|DigiMortal|LINK
Apr 14, 2008 08:46 PM|Davedavex|LINK
Can you please be more specific how I can achieve this in Visual Studio? Thanks a lot.
Apr 15, 2008 12:53 PM|DigiMortal|LINK
Apr 16, 2008 10:43 AM|Davedavex|LINK
Hi, I have compiled the project with the Regiser for COM Interop option checked. but I still have the exception. It is just weird that I can comsume the component in Win form application, but not in windows
service. Doesn't make sense to me as they all are running under the .net framework.