473,796 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you catch missing DLL errors?

Hi all.. my application uses a custom dll which should be in the same
directory as the exe file. If the dll file is missing the application
immediately aborts with a "Applicatio n has generated an exception that could
not be handled" exception.

I would like to catch the error and display a meaningful message. I tried
TRY CATCH in the SUB Main(), I tried ON ERROR in the SUB Main(), I also
tried to test for a fileinfo.exists on the dll file right at the beginning
of the program. Nothing seems to be able to catch the error before it
happens.

One other piece of info... The application has a Startup Module which is
the starting point. This is where I define my "error handler of last
resort". In the startup module I do an Application.Run (new FORM1) to get
the actual program kicked off. I believe that the problem might arise
because in the startup module I do an IMPORT of my custom DLL file, and I
also create a reference to a singleton pattern class which is defined in the
"missing" DLL. Here is the reference to the class in the DLL file: Dim
GlobalItems As GlobalLibraryVa rs = getGlobalVarsOb ject()

So, between the Imports statement and generating the DIM that references the
"missing" DLL file, I don't seem to be able to catch the error. Looks as if
the system processes the DIM statements before executing the Sub Main()
procedure. If that is the case, it's trying to access the DLL library
before I get control in the Sub Main() to set an error handler...

Am I missing something obvious? Any suggestions?

thanks, John
Nov 21 '05 #1
0 1203

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
6895
by: kaeli | last post by:
Hey all, I'd like to start using the try/catch construct in some scripts. Older browsers don't support this. What's the best way to test for support for this construct so it doesn't kill non-supporting browsers? TIA -- --
9
2358
by: Joe Rigley | last post by:
Hello, As a .NET newbie I'd appreciate some advice... I've been tasked with writing a small app (in VB .NET) that takes some data from our HR system, does some format modifications, and loads that into Active Directory. For error handling of this app, I was considering having the app process each employee one at a time. If an error occurs, I was thinking that the system would handle the error with a Try/Catch, send the error details...
8
7822
by: Daniel Portal | last post by:
Hi there, I'm in 3-tier project and I'm thinking about having Try / Catch statements in each method, just in case you know! If the case is that I don't have a special treatment for the error in some method I would Cath the error and Re-Throw it! The question is: what are the issues of this approach? Would I have performance problems cus of my catches? What does MS recommends in such a situation??
11
1493
by: Tamas Demjen | last post by:
I was shocked to learn that VC++ 2005 Beta 2 can't catch Access Violation exceptions in unmanaged code. To reproduce this, I created a minimal Win32 console application: #include "stdafx.h" int _tmain(int argc, _TCHAR* argv) { int* p = 0;
5
4331
by: JohnR | last post by:
Hi all, I have an application that uses a custom DLL. The DLL needs to be in the same directory as the executable. If it's not I want to catch the error and give a meaningful message to the user. Right now, the appl immediately aborts with a cryptic "Application has generated an exception that could not be handled" error. the application starts in a STARTUP Module and then starts up the main form. I've tried ON ERROR, TRY CATCH,...
32
6129
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I understand Finally runs whether an error was caught or not, I haven't found a use for finally yet.
1
2013
by: aemado | last post by:
I am trying to read in several lines, each should have exactly 5 pieces of data. I am using try/catch/throw to determine if the data is in the correct format, and trying to use iss to separate the parts. However, this is my first time using both, and I am pretty certain that I am missing something obvious. Firstly, by debugging, I found that the first piece of data is being checked in the second case, giving me errors. I believe I may need to...
5
14328
by: kellygreer1 | last post by:
I think I'm not quite understanding something about error handling in PHP5. I have written some PHP code to index the contents of C drive on a Windows machine. When it gets to certain special folders (fake folders) it runs into errors. Directories it can not read from. I have tried wrapping the code in a Try / Catch and the error still comes through. What am I missing? <?php // Here is the code: function indexFiles($path, $handle) {
3
1690
!NoItAll
by: !NoItAll | last post by:
OK, I'd like to know the difference between the following two blocks of code: Block A Try Something Catch Process Errors End Try
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.