I am learning DLL creation and implemention from Programming Applications for Microsoft Windows by Jeffrey Richter. Richter demonstrations are straightforward and appear simple. However, I cannot implement a working at all using Visual C++ .NET.
I tried using the DLL Wizard and hardcoding a .cpp and .h file. Neither method worked. I would like to create a simple dll with functions I can use in any C++ programs I work on including MFC. In fact, all my Windows program are MFC. Here is an example of the code.
#define myDLL extern "C" __declspec(dllimport)
class myDLL MyClass
#define myDLL extern "C" __declspect(dllexport)
The code above uses the exact sample algorithm Richter presents in his book. It is does not work. I would like a good solid working example of creating a dll that works in both MFC and non-MFC Windows programs.