[C++] Hooking IDirect3DDevice9::Present

09/05/2009 23:30 Xorg#1
Hi
I am trying to hook this function.
Code:
HRESULT (WINAPI IDirect3DDevice9::*pOrigPresent)(CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion) = &IDirect3DDevice9::Present;

HRESULT WINAPI m_Present(CONST RECT * pSourceRect,CONST RECT * pDestRect,HWND hDestWindowOverride,CONST RGNDATA * pDirtyRegion)
{
	printf("Hooked\n");
    return pOrigPresent(pSourceRect,pDestRect,hDestWindowOverride,pDirtyRegion);
}
Problem with compilation:
Code:
Error C2064: term does not evaluate to a function taking 4 arguments
Error moves to return pOrigPresent(pSourceRect,pDestRect,hDestWindowOver ride,pDirtyRegion);

Help please