What do you mean "added in as new item"?
I usually use something like this:
header file:
Code:
#include <windows.h>
#ifdef EXPORT_HOOK_FUNCS
#define HOOK_DECLSPEC __declspec(dllexport)
#else
#define HOOK_DECLSPEC __declspec(dllimport)
#endif
HOOK_DECLSPEC BOOL MyFunction(HWND hAppWnd);
HOOK_DECLSPEC BOOL AgainMyFunction(HWND hAppWnd);
And include it in both, the dll and the program.
DLL:
Code:
#define EXPORT_HOOK_FUNCS
#include "dll.h"
BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD,LPVOID){
return TRUE;
}
HOOK_DECLSPEC BOOL MyFunction(HWND hAppWnd) {
MessageBox(hAppWnd,"This is me, the DLL","Hi",MB_OK);
return TRUE;
}
HOOK_DECLSPEC BOOL AgainMyFunction(HWND hAppWnd) {
MessageBox(hAppWnd,"This is me, the DLL (no 2)","Hi",MB_OK);
return TRUE;
}
Program (you must link it with the library that was created with the DLL):
Code:
#include "dll.h"
.......
MyFunction(hwnd);
.......