By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,210 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,210 IT Pros & Developers. It's quick & easy.

Error handling in .net Class Library / Visual Basic

P: n/a
Hi,

I need some help in making a design choice for a project which we are
currently working on.
My client has a VB6 application which we don't see them actually
changing in the near future.

They are asking us to produce an dll interface component to interface
directly with the vb6 app. Now initial thoughs were to write the dll in
VB6 and have done with it. However Vb6 resources are thin on the ground
now and we have mainly c# developers around.

I understand a bit about .net error handling and have read an article
about Vb6 using .net class library's. The one specific requirement we
have though is if say a file is not found, we need to raise error code
12000 (ERR_IO) back to the Vb6 app so they can manage the error. The
world of .net error handling looks different and I can't off hand see
how I might invoke an error in .net which can then be managed
meaningful in VB6.

Can anyone help.

Regards

Jan 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try this:
throw(new System.Runtime.InteropServices.COMException("an error",
vbObjectError + 12000));

vbObjectError is -2147221504 I believe from a google, I imagine it's
defined in one of the vb.net runtime libraries, but I didn't look.

On 26 Jan, 10:42, simonrobs...@gmail.com wrote:
Hi,

I need some help in making a design choice for a project which we are
currently working on.
My client has a VB6 application which we don't see them actually
changing in the near future.

They are asking us to produce an dll interface component to interface
directly with the vb6 app. Now initial thoughs were to write the dll in
VB6 and have done with it. However Vb6 resources are thin on the ground
now and we have mainly c# developers around.

I understand a bit about .net error handling and have read an article
about Vb6 using .net class library's. The one specific requirement we
have though is if say a file is not found, we need to raise error code
12000 (ERR_IO) back to the Vb6 app so they can manage the error. The
world of .net error handling looks different and I can't off hand see
how I might invoke an error in .net which can then be managed
meaningful in VB6.

Can anyone help.

Regards
Jan 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.