Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Check for library exist or not.

Posted on 2003-03-21
7
Medium Priority
?
174 Views
Last Modified: 2010-05-01
I have a program with reference to MS Office libraries. If my program is installed in a computer without MS Office, How could I check that so that my program could run correctly?
0
Comment
Question by:chpchai
7 Comments
 
LVL 1

Expert Comment

by:FunkyMeister
ID: 8200050
Any function that hasn't been used won't load the dll needed for it until it actually happens, find an obscure function in the dll that does little (or doesn't do anything bad), give it values it can use to do little with (or not) and call the function, the standard "File Not Found" will happen if the library doesn't exist.

Error #53, "File Not Found".

Quickest way to know a DLL (even when it SHOULD exist) isn't loading correctly, either because it went bad or isn't there.
0
 

Author Comment

by:chpchai
ID: 8216618
Could you give me more explaination, I am not sure how to do.
0
 
LVL 1

Accepted Solution

by:
FunkyMeister earned 80 total points
ID: 8218410
On Error GoTo CallDied
Call [some API call here]
On Error GoTo 0 ' API call was nice.

....

GoTo EndOfRoutine

CallDead:
if Err.Number = 53 then
 Msgbox "Required DLL Missing!" ' Keep it Cryptic, the Microsoft way.
 GoTo [Code to exit program cleanly] ' Or call function that terminates the program.
' Other error checking here.
Resume Next

EndOfRoutine:
Exit Sub/Function here

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:FunkyMeister
ID: 8218437
The Call [some API call here] is where you call your DLL or Any DLL for that matter.  Typically, if you want to have a global function that does error testing then place a value (boolean) around the call:

DllCall = True
Call [DLL]
DllCall = False

Then in the CallDead routine:

if Err.Number = 53 Then   replaces to if Err.Number = 53 And DllCall = True Then

The Resume Next will take the DllCall back to false, if it's not a serious error (like a bug in your code, no wait, it's not bug, it's an ISSUE, yes, thats it, ISSUE.  Someone grab me a tISSUE).
0
 

Expert Comment

by:CleanupPing
ID: 8531845
Hi chpchai,
This old question (QID 20559346) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8982563
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.
It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 9046157
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept FunkyMeister's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question