An application that uses dynamic link libraries can be forced to execute malicious code, even without replacing the target .dll file by exploiting:
Registry settings
The library search order
Buffer overflows
Library input validation flaws