By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,661 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,661 IT Pros & Developers. It's quick & easy.

How to Ignore Missing Libraries ?

P: n/a
I have an object which needs the WithEvents Declaration. But some
machines which it is installed on will not have the DLL. Is there an
easy way to ignore the Error 'Can't find project or library' which
will popup.

michael
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Unfortunately, no. And, to make matters worse, assuming you're set a
reference to the DLL, having it missing can cause other functions in totally
unrelated libraries to stop working.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<mi*****@yahoo.com> wrote in message
news:rs********************************@4ax.com...
I have an object which needs the WithEvents Declaration. But some
machines which it is installed on will not have the DLL. Is there an
easy way to ignore the Error 'Can't find project or library' which
will popup.

michael

Nov 13 '05 #2

P: n/a
On Tue, 7 Jun 2005 18:40:17 -0400, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:

If you only wanted to call methods and properties, a technique called
"late binding" would help. But since you're also listening for events,
early binding is the only option, and the reference would have to
exist on each machine.

You could create two slightly different versions of your app.

-Tom.

Unfortunately, no. And, to make matters worse, assuming you're set a
reference to the DLL, having it missing can cause other functions in totally
unrelated libraries to stop working.


Nov 13 '05 #3

P: n/a
There are two things you could try but neither of them is trivial.

1) Disambiguate every library call. e.g. don't call the Right function call
the VBA.Right function, this will be extremely tedious and of course any
calls to the missing library will still fail.

2) Instead of using events implement a callback interface.
To do this you would wrap the calls to the dll in another dll (which you can
write in VB) the wrapper dll exposes an interface which you can then
implement in a class module in your Access db.

From Access you reference your wrapper dll, then at runtime you create an
instance of a class in the wrapper dll and pass an instance of your Access
class which implements the callback interface.

The wrapper dll then receives the events from your 3rd party dll, when it
receives an event it then calls the appropriate procedure on the interface
to your Access db.

In this way you can handle any errors from the dll being missing from your
wrapper dll rather than in Access.

I've not tried method 2 myself but believe it should work.
--
Terry Kreft
MVP Microsoft Access
<mi*****@yahoo.com> wrote in message
news:rs********************************@4ax.com...
I have an object which needs the WithEvents Declaration. But some
machines which it is installed on will not have the DLL. Is there an
easy way to ignore the Error 'Can't find project or library' which
will popup.

michael

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.