copy and paste the directx 9.0 dll files into your program directory folder.
or (better option)
if you know what the directx 9.0 dll files that your program require then copy and paste those dlls to your program directory folder. (usually the compiler will tell what dlls are missing at the program run time.
Quote: "are you asking why:"
because when any program runs in windows, it will look for the dlls in its own directory first. then if it doesn't find any, it will go and search the system32 or 64 depends on the win platform.