Link to home
Start Free TrialLog in
Avatar of chpchai
chpchai

asked on

Check for library exist or not.

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?
Avatar of FunkyMeister
FunkyMeister

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.
Avatar of chpchai

ASKER

Could you give me more explaination, I am not sure how to do.
ASKER CERTIFIED SOLUTION
Avatar of FunkyMeister
FunkyMeister

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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).
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.
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:
https://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
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