Hi.
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.
-----
// myDLL.h
#ifndef myDLL
#define myDLL extern "C" __declspec(dllimport)
#endif
class myDLL MyClass
{
MyClass();
void FunctionOne();
int FunctionTwo();
~MyClass();
-----
-----
// myDLL.cpp
#define myDLL extern "C" __declspect(dllexport)
#include "stdafx.h"
#include "myDLL.h"
MyClass::MyClass()
{
}
...
-----
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.
Thanks,
Kuphryn