469,600 Members | 2,326 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,600 developers. It's quick & easy.

Error handling in .net Class Library / Visual Basic

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
1 2455
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.

Similar topics

6 posts views Thread by Peter Frost | last post: by
9 posts views Thread by Gustaf | last post: by
reply views Thread by simonrobshaw | last post: by
35 posts views Thread by jeffc226 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.