Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for presence of DLLs on a PC 1

Status
Not open for further replies.

beedubau

Programmer
Jan 7, 2003
97
AU
I would like to use the following code to try to test if required dlls are installed.

Code:
PARAMETERS mydll


DECLARE INTEGER FreeLibrary IN kernel32;
	INTEGER hLibModule

	?isDLLAvailable(mydll)


FUNCTION isDLLAvailable(DllFilename)
LOCAL hModule

hModule = LoadLibrary(DllFilename)
IF hModule > 32
	FreeLibrary(hModule)
	lRetval = .T.
ELSE
	lRetval = .F.
ENDIF
RETURN lRetval
ENDFUNC

When stepping the code I get an error on hModule = LoadLibrary(DllFilename) - LoadLibrary not found().

As a consequence It always returns .T.

Can anyone help with this?

Regards

Bryan
 
Thanks Mike,

I've now got some work to do <G>

Bryan
 
As a further and better is there a similar way to test for OCXs loaded.

This routine gives a false on an OCX but its there and it works in the app.

But I'd like to check if its registered after install.

Regards

Bryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top