Help, making a callback
#1

Code:
int AnEventForCallingBack()
{
    int idx; 
    cell ret, amx_Address,*phys_addr;
    int amxerr = amx_FindPublic(pAMX, "OnMouseWheelScroll", &idx);
    if (amxerr == AMX_ERR_NONE)
    {
		amx_Exec(pAMX, &ret, idx);
        return 1;
    }
    return 0;
}
Error:
1>c:\users\usuario\documents\visual studio 2010\projects\tbr\tbr\tbr.cpp(35): error C2065: 'pAMX' : undeclared identifier
1>c:\users\usuario\documents\visual studio 2010\projects\tbr\tbr\tbr.cpp(38): error C2065: 'pAMX' : undeclared identifier

I know I must declare pAMX, but I am noob in c ++
Code:
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{

    MSLLHOOKSTRUCT * pMouseStruct = (MSLLHOOKSTRUCT *)lParam;

    if (wParam == WM_MOUSEWHEEL) 
	{
		if (HIWORD(pMouseStruct->mouseData) == 120)
		{
			AnEventForCallingBack();
		}
		else logprintf("down");
 
	}
    return CallNextHookEx(0, nCode, wParam, lParam);
}
Reply
#2

I am not sure about this, but should not it be:

Code:
int AnEventForCallingBack(AMX* pAMX) //to check/find publics present in the abstract machine
{
    int idx; 
    cell ret, amx_Address,*phys_addr;
    int amxerr = amx_FindPublic(pAMX, "OnMouseWheelScroll", &idx);
    if (amxerr == AMX_ERR_NONE)
    {
		amx_Exec(pAMX, &ret, idx);
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)