472,371 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 2597
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.