Is there any way to not have to copy the DLL my C++ program uses (and is linked to) to the system32 folder? Why won't it run even when the DLL is right next to the EXE that uses it? If there is a solution, here is my code to modify:
Prog.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <windows.h>
#include <cstdlib>
#include "dll.h" // DLL Header
usingnamespace std;
int main()
{
SetColor(10); // Function inside the DLL
cout << "Hello world!";
system("PAUSE>NUL");
}
It should work when the DLL is in the working directory. Make sure you are executing it so that its working directory is the directory it itself is in.