tags:

views:

119

answers:

1

Hello,

I have a com interop c++ dll that is loaded in c++ throught the .tlb file generated in c#. When I run in my computer it works fine but when I run in a computer that just got formated it gives:

WindowsError: exception code 0xe0434f4d

Do I have to do something for the .tlb file or its dll to be registered in the system? Something regarding regasm.exe?

If so, it is possible to only download regasm.exe and use it?

Thanks in advance!

+2  A: 

Sorry, you're a million miles from diagnosing this correctly. Type libraries are for compilers, they are not (usually) needed at runtime.

The exception code you are getting shows what is going wrong. It is the exception code for a managed exception. In other words, your C# code is throwing an exception and it isn't being handled. Which is pretty common for C# code, when it finds a problem that it doesn't know how to handle then it throws instead of plodding on generating garbage data.

There are two basic ways to tackle this. The Q&D approach is to use a debugger switched to managed mode and make it stop on an unhandled managed exception. Debug + Exception, Thrown check box, for example. Or you could add some diagnostics to the method itself, logging the error in a catch block for example.

Start with Q&D, it is almost always something silly, like FileNotFound.

Hans Passant
aF
Hans Passant