|
-
May 2nd, 2001, 01:30 AM
#1
How to pass the address of a function in a DLL(Built with VC++) to API function?
Hi,
I'm trying to control a dialog window created by another process in VB, so I think I need a global hook. I write a C DLL with a Callback function in it and declared it in an module in my VB project. and I want to pass this function to the Windows API SetWindowsHookEx. But error occurs when I use the Addressof operator.
The definition of the callback function in the dll is like this:
LRESULT WINAPI __stdcall MessageProc(int nCode, WPARAM wParam, LPARAM lParam);
and I declare it in VB like this:
public Declare Function MessageProc Lib "MyDll.dll" (byval nCode as integer, byval wParam as long, byval lParam as long) as long
What's the problem?
Thx.
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
|