Here is the source, I took the_winch's example code and modified it
dllmain.c
// the_winch : http://winch.dbspot.com/ : d_d@glay.org
#define WIN32_LEAN_AND_MEAN
#include <dll.h>
#include <stringtable.rc>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
DLLIMPORT int PrintName( void ){
return 42;
}
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;
}
dll.h
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT char PrintName( void );
#endif /* _DLL_H_ */
the resource file
#define PrintName 1
STRINGTABLE DISCARDABLE
BEGIN
PrintName "PrintName"
END
All of these are in the same directory...
Come to #coding. We promise we wont kick you!
DISCLAIMER: Promises may not actually be upheld.