You have two problems. First, remove WS_CHILD from the dialog. WS_DISABLED probably isn't all that useful either.
Second, you're not declaring the DLL function correctly in the client. Two ways to fix this:
Code:
#include <windows.h>
extern "C" __declspec(dllimport)
LRESULT DisplayMyMessage(HWND hwndOwner);
#pragma comment(lib, "Con2DLL.lib")
int main()
{
DisplayMyMessage(0);
return 0;
}//main
Or...
Code:
#include <windows.h>
#include <iostream>
using namespace std;
typedef LRESULT (*DisplayMyMessage_pfn)(HWND);
int main()
{
HMODULE hmod = LoadLibraryA("Con2DLL.dll");
if (!hmod)
{
cerr << "LoadLibrary failed, le = " << GetLastError() << endl;
return 1;
}//if
DisplayMyMessage_pfn dm =
(DisplayMyMessage_pfn)GetProcAddress(hmod, "DisplayMyMessage");
if (!dm)
{
FreeLibrary(hmod);
cerr << "GerProcAddress failed, le = " << GetLastError() << endl;
return 1;
}//if
dm(0);
FreeLibrary(hmod);
return 0;
}//main
gg