I have a 3rd party component that includes a .LIB and .DLL file. In order to use the component I link the .LIB into my C++ program, and distribute the .DLL with application. The functionality provided is very specific, and only relevent to a small sub-set of my users, but distributing the .DLL incurs a license fee.
One work around here is to have two versions of my app, one which links in the 3rd party component, the other that doesn't, but I'd rather avoid the extra time involved in maintaining and distributing a second build.
Ideally, I'd like to simply exclude the .DLL from the distribution, but if I do this I get the error 'This application has failed to start because XXXXX.DLL was not found. Re-Installing the application may fix this problem'. Is this an exception that I can catch and deal with in my code? Alternatively, can I delay the loading of the .DLL until an attempt is made to call the specific functionality provided, and handle it then, or simply check for the existence of the .DLL and act accordingly?
The environment is VS 2003 and VS 2008.