I have just watched a video tutorial on how to set up a C++ DLL file to call in Excel VBA. I’m just doing a simple one to start off with. So I open a new win32 project and chose DLL and empty project in the application wizard and proceed. Then I make a .cpp file and a .def file as follows:
square.cpp file:
double __stdcall square(double & x)
{
return x*x;
}
defFile.def:
LIBRARY "square"
EXPORTS
square
Then to project properties -> Linker -> input-> Module Definition File: defFile.def
and then I compile.
Now, a .dll file should appear in the project Debug folder, but it doesn’t. Any idea’s whats wrong?
P.S. I’m fairly new to programming so try and go easy on the terminology.
By default, VC++ uses two folders named Debug when you compile a project, one at the solution’s directory and the other in the project’s directory.
First you should check if there were any errors during the compilation. If it’s succeeded, then you can proceed to check the folder named Debug in your solution path.
You can go there just by right-clicking in
Solution 'square' (1 project)in the Solution Explorer, and selectingOpen folder in Windows Explorer. Then going into the first folder name Debug. By default, that’s where VC++ stores the final executable. The other Debug folder, located in the project’s directory is just for intermediary files.