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



On Wed, 24 Jan 2007 12:29:29 -0800, "Ken Halter"
<Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

"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.

Cheers Ken, I originally had 'Set MyObject = New DllObject' in there as
well, but deleted it for some reason...my bad !

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
--
Alfie [UK]
<http://www.delphia.co.uk/>
Hey man, that god complex is showing again.

.



Relevant Pages

  • Re: How to programmatically tell if a DLL is present?
    ... 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 ... 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: Write-once with DLL shared memory
    ... > that there was no Shared section in my Release version of the DLL. ... > launching the Debug version, I was launching the Release version, which ... > destination process did see the flag being set, ... -Software Consultant (Embedded systems and Real Time Controls) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Register filter built with Visual Studio 2005
    ... In both the dll and the SourceFilter I am using the /MT flag. ... but that gives me linker errors due to unresolved externals in ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Problems by loading an IISR
    ... it's not a driver - just an ordinary dll - works very well. ... ISR dlls must be inclosed in the CE image specifying a specific "K" ... flag in their attributes. ... (l'indirizzo di reply di questo messaggio non è ...
    (microsoft.public.windowsce.platbuilder)