Ну и в использовании всяких там сишных либ/функций дофига костылей часто бывает. The search path can be altered using the SetDllDirectory function. This solution is recommended instead of using SetCurrentDirectory or hard-coding the full path to the DLL. Типа таких.