Click here to Skip to main content
15,888,285 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi all,

I am working on one of my project in vb.net.

I am having problem in one of my cases which is as follows.

i have one form in dotnet solution, now on clicking of Ok on that form i will be calling a method which implements the COM interface method.in that method i am throwing an error in a particular case ,now catch is handled and inside that catch i need to inform to Com solution that error has occured .

but when i wrote throw in the catch block it says "
SQL
Fatal Execution Engine Error

" and my dotnet solution is getting crashed.Googled it but havent got idea what cause s this error and hoe to fix it?

Anybody Please suggest


Also i have given the COM reference to dotnet solution by by Add Reference-->COM add TLB direclty instead of generating dll and proceeding
Posted
Updated 2-Dec-15 7:14am
v2
Comments
Nathan Minier 2-Dec-15 13:22pm    
Writing throw in a catch block is completely redundant; it basically says "if there's an exception, throw it again to the operational environment." This is really only appropriate in a development environment, and then it should throw a NotImplementedException() instead.

If you're trying to handle the exception, and you know exactly what it is, perform your error handling and do not re-throw it. You can always wrap the calling code in a try-catch block if necessary.
vAS21 2-Dec-15 13:26pm    
Thansk Nathan,

But in COM code one operation will be going on, if there is any exception in my current dotnet method it should inform COM that error has occured so stop the process, for that in my catch i need to throw the exception to COM
CHill60 4-Dec-15 4:30am    
It sounds like you should be running that process in a separate thread - are you using a threading model? Without seeing any of your code it is very difficult for any of us to offer suggestions!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900