|
-
December 21st, 2008, 02:59 PM
#1
Help Needed Using DLL
I have created a dll that has only one function in it and then i use that dll in a new project but the code is unable to locate the function in the dll
MouseHandle Dll
MouseHandle.h
#ifndef _MOUSE_HANDLE_H_
#define _MOUSE_HANDLE_H_
#include <windows.h>
#include <stdio.h>
extern "C" __declspec(dllexport) LRESULT CALLBACK MyMouseProc(int,WPARAM,LPARAM);
#endif
MouseHandle.cpp
#include "MouseHandle.h"
extern "C" __declspec(dllexport)
LRESULT CALLBACK MyMouseProc(int nCode,WPARAM wParam,LPARAM lParam) {
MessageBox(NULL,L"SUCCESS",L"ERROR",MB_ICONEXCLAMATION | MB_OK);
return 0;
}
Then i use this dll in my test project which doesn't works
#include <windows.h>
#include <stdio.h>
static HINSTANCE hinstDLL;
static HHOOK hhookSysMsg;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow){
HOOKPROC hkprcSysMsg;
hinstDLL = LoadLibrary(L"MouseHandle.dll");
if(hinstDLL == NULL)
errormessage();
hkprcSysMsg = NULL;
GetProcAddress(hinstDLL, L"MyMouseProc");
if(hkprcSysMsg == NULL)
errormessage();
return 0;
}
The program compiles well but on debuggin gives the error "The Specified Procedure cannot be found"
The Program is unable to find the procedure "MyMouseProc" in the dll
Have I done any error in making the dll ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|