title: When calling unmanaged code from VB.NET, is it more reliable to use DECLARE LIB or DllImportAttribute?
body: <p>We have a VB.NET program that needs to periodically call a function in an external, unmanaged DLL to communicate with our legacy application.  We are having a problem with the application (seemingly) randomly not being able to find the DLL with the unmanaged code.  Currently we use DECLARE FUNCTION blah LIB for the unmanaged code.  Would it be better/more reliable to use DllImportAttribute instead?  Or am I missing something else?</p>