Put the code you need help with here.
#include <iostream>
#include <cstdlib>
#include "dll.h"
usingnamespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
DllClass c;
c.HelloWorld();
system("PAUSE");
return EXIT_SUCCESS;
}
/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include <windows.h>
DllClass::DllClass()
{
}
DllClass::~DllClass()
{
}
void DllClass::HelloWorld()
{
MessageBox(0, "Hello World from DLL!\n","Hi",MB_ICONINFORMATION);
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
{
break;
}
case DLL_PROCESS_DETACH:
{
break;
}
case DLL_THREAD_ATTACH:
{
break;
}
case DLL_THREAD_DETACH:
{
break;
}
}
/* Return TRUE on success, FALSE on failure */
return TRUE;
}
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
#define DLLIMPORT __declspec(dllexport)
#else
#define DLLIMPORT __declspec(dllimport)
#endif
class DLLIMPORT DllClass
{
public:
DllClass();
virtual ~DllClass();
void HelloWorld();
};
#endif