Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / November 2003



Tip: Looking for answers? Try searching our database.

Exception vs Return Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
adi@message4u.com - 28 Nov 2003 01:02 GMT
Dear all,

This is more like a theoretical or conceptual question:
which is better, using exception or return code for
a .NET component?

I had created a COM object (using VB6), which uses return
code (not generating error/exception) so it is more
compatible with other programming language.

Now we are migrating the COM object into .NET component
but wondering whether I should change my code to work
with exception instead? How popular is the use of
exception? Is it supported by all .NET-enabled
programming language?

Thanks,
Adi
Joe - 28 Nov 2003 06:56 GMT
> This is more like a theoretical or conceptual question:
> which is better, using exception or return code for
[quoted text clipped - 3 lines]
> code (not generating error/exception) so it is more
> compatible with other programming language.

Anything using COM had better be able to deal with HRESULT,
which is the standard COM way of passing back return codes,
and all methods in your VB class interfaces return HRESULT.

> Now we are migrating the COM object into .NET component
> but wondering whether I should change my code to work
> with exception instead? How popular is the use of
> exception? Is it supported by all .NET-enabled
> programming language?

They had better be, or they'll get the Shaft.NET even worse
than Visual Basic did!

--
Joe Foster <mailto:jlfoster%40znet.com>  "Regged" again? <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.