473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2694
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
13
by: MLH | last post by:
I'm thinking that maybe error trapping code could be in a global module (standard procedure) and a Master "OnError" statement could be set. Is anything like this in use with VBA for A97?
11
by: Wolfgang Kaml | last post by:
I am not sure if this is more of an expert question, but I am sure that they are out there. I'd like to setup a general application or bin directory on my Win2003.Net Server that will hold some...
9
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected...
4
by: LCAdeveloper | last post by:
I have had to move to Visual Studio.NET Pro. from Visual Basic 4.0 and am now starting to re-write our code. I was a bit surprised to find that Visual Basic.NET no longer supports fixed length...
9
by: Gustaf | last post by:
I'm confused about structured error handling. The following piece of code is a simplification of a class library I'm working on. It works, and it does what I want, but I'm still not convinced that...
0
by: simonrobshaw | last post by:
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. ...
35
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.