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
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
You just need to cast the GetProcAddress to whatever your function prototype is, you can define your own function pointers for this.
What you were doing is just loading the procedure but it wasn't stored anywhere. Now you call hkprcSysMsg like you would the DLL function itself.
"Windows programming is like going to the dentist: You know it's good for you, but no one likes doing it."
- Andre LaMothe
How did you even compile that? GetProcAddress doesn't take pointer to a wide string.
To Notsosuperhero: although you are right, the cast you suggested won't help to fix OP's error "The Specified Procedure cannot be found".
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio: FeinWindows - replacement windows manager for Visual Studio, and more...
Not sure what do you mean.
1. The (HOOKPROC) cast has nothing to do with the error.
2. Regardless of whether UNICODE was used or not, the GetProcAddress() function is only available in one flavor (unlike many other API function); it doesn’t take a wide string, and the prefix L in front of the text literal explicitly means: wide.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio: FeinWindows - replacement windows manager for Visual Studio, and more...
You are correct. I didn't know that. In my defence, if there would be any mention of WinCE - I would stay out of this thread.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio: FeinWindows - replacement windows manager for Visual Studio, and more...
. . .
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
With this declaration the exported name must be _MyMouseProc@12.
Besides, I cannot see any reason to resolve dll entry explicitly. Why don't you go with .lib?
You just need to cast the GetProcAddress to whatever your function prototype is, you can define your own function pointers for this.
What you were doing is just loading the procedure but it wasn't stored anywhere. Now you call hkprcSysMsg like you would the DLL function itself.
I have tried this but doesn't helped , so i removed it but of no use.
use Depends.exe from "Microsoft Visual Studio 8\Common7\Tools\Bin" and check you dll to see if the name of your exported function is the same...
I used the tool it showed the function name as MyMouseProc. I still don't know what to do ??
I am attaching the result of the depend.exe with this reply
I used the tool it showed the function name as MyMouseProc. I still don't know what to do ??
Say the truth is what to do. Either you miss (or cripple somehow) the CALLBACK modifier in your dll, or you use .def file that unmangles the exported name.
See my sample, and you see all works fine so far.
Last edited by Igor Vartanov; December 27th, 2008 at 10:49 AM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.