Solved

An unhandled exception of type

Posted on 2003-11-19
8
711 Views
Last Modified: 2013-12-03
Hi i am trying to run a c sharp application which uses a class library, the class library uses the System.runtime.interopservices namespace.


when i compile the project i get no errors but when i run the project i get the following:

An unhandled exception of type 'System.Runtime.Interopservices.comexception' occured in sncl.dll

Additional information: Com object with CLSID {499C0c20-A766-11cF-8011-00A0c90A8F78} is either not valid or not registered.

can someone help as this is urgent.
regards Chris
0
Comment
Question by:chris_shadow
8 Comments
 
LVL 9

Expert Comment

by:WinterMuteUK
ID: 9781261
If you put the code into a try/catch thingy, you might be able to get a clearer response:
try {
     <your code>
}
catch (Exception ex) {MessageBox.Show(ex.ToString());}
0
 

Author Comment

by:chris_shadow
ID: 9781303
tried exactly the same error messages
0
 
LVL 15

Expert Comment

by:SRigney
ID: 9781365
Are you trying to run the code on the same machine you wrote it on?

Does it still run through the IDE?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:chris_shadow
ID: 9781572
yep i am running on the same machine, i dont understand why im getting an error with system.runtime.interopservices


silly question but does anyone know of a component set to communicate with a pocket pc, i cant use activesync as i need programatically handle up to 10 pocket pcs at the same time.

chears
0
 
LVL 15

Expert Comment

by:SRigney
ID: 9781673
Are you running from the Release folder, or did you try moving files around?

Not sure on the PocketPC question, you'll be much better off posting this as an additional question.  I'm sure there are some experts out there that may miss the oportunity to answer that question because they don't look into the question about your unhandled exception type.
0
 

Author Comment

by:chris_shadow
ID: 9781849
im runnig from the debug folder
0
 
LVL 4

Expert Comment

by:wile_e_coyote
ID: 9782166
I think this exception means that your .NET code is attempting to call an unregistered COM DLL.     Are you using any COM components?
0
 
LVL 6

Accepted Solution

by:
purpleblob earned 500 total points
ID: 9786137
The error message you are getting is fairly self explanatory (if it's telling the turth :-) ), it would appear that the COM object you're trying to talk to has not been registered on the machine that you're running the .NET application from.

How did you reference the COM object, i.e. did you create the interop by adding a reference to the COM object ? Are you running the .NET application from the machine that the COM object is registered on ?

I quickly checked my registry on this - the CLSID is that of the Connection Manager. You could do a search of the registry (if you're happy interacting with the registry) and check the CLSID actually exists.

Note: as COM object's are instantiated as and when required you will find that the application will compile fine, it's at the point of CreateInstance (which happens in the interop) where the CLSID will be passed into and then will fail if the object does not exist).

Hope this helps

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question