/* Replace "dll.h" with the name of your header */
#include "dll.h"
#include "windows.h"
#include "stdio.h"
extern "C"
{
DLLIMPORT void hello(char *in,char *out,int n);
}
DllClass::DllClass() { }
DllClass::~DllClass () { }
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
DLLIMPORT void hello(char *in,char *out,int n)
{
int i;
printf ("DLL Hello %s\n",in);
out[0]='Y';
}
沒有留言:
張貼留言