Re: How to programmatically tell if a DLL is present?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Alfie [UK]" <alfie@xxxxxxxxxxxx> wrote in message
news:av5fr255uh9qotsbqm340s02edrg6m5vs7@xxxxxxxxxx

Not sure if it's the best method but you could just error trap the first
attempt at creating an object from the DLL and set a flag for the rest
of your program to react to.

Rough and ready code;

Public DllFlag as Boolean

On Error Resume Next
Dim MyObject as DllObject
If Err = 0 Then

Dim isn't enough to raise an error. You'll have to actually attempt to
create an instance of one of the classes the DLL exposes. Other than that,
error trapping is a perfect choice.

If anyone wants to "get fancy", my ComGuard add-in will create a class that
checks dependencies on everything your app requires to run (the first layer,
anyway)

http://www.vbsight.com/ComGuard.htm

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm


.



Relevant Pages

  • Re: How to programmatically tell if a DLL is present?
    ... attempt at creating an object from the DLL and set a flag for the rest ... Dim MyObject as DllObject ... create an instance of one of the classes the DLL exposes. ...
    (microsoft.public.vb.general.discussion)
  • Re: File Version without GetFileVersionInfo
    ... I think in NT+ OS you cannot rename a file if it's open without ... FILE_SHARE_DELETE flag. ... Mapped executables and DLLs are opened without it. ... How can you replace a currently-installed DLL? ...
    (microsoft.public.vc.mfc)
  • Re: and yet another Vista question
    ... Clicking properties on the dll under security, etc, shows it's valid under ... Set clsRes = CreateObject ... but it seems to me your own error handler would have shown a "no resource" ... your error trap would prevent VB from reporting the ...
    (microsoft.public.vb.general.discussion)
  • Re: dll has unknown/unsupported attribute K
    ... Bruce.Eitman AT Eurotech DOT com ... My guess is that your version of WM is not based on CE6, where the K flag ... When I do a "makeimg" I get the following warning message for a newly ... Am I missing something for this dll. ...
    (microsoft.public.windowsce.embedded)
  • Re: CE 6.0 stops at jumping to 0x022... (no debug messages show up
    ... To add to what Paul said, any DLLs that the Kernel one requires also ... If any particular DLL needs access in both Kernel and User Mode ... then you need the Q flag. ...
    (microsoft.public.windowsce.platbuilder)