Pointers... again... f-n noobs...

From: TheEngine (zmengine_at_shaw.ca)
Date: 03/26/04


Date: Fri, 26 Mar 2004 17:32:06 GMT

I'm a bit lost trying to setup a multimedia timer using the Win32 API - I'm
pretty sure I'm not using the parameters correctly (timeSetEvent and
TestProc callback). Can anyone tell me how I can I do this?

UINT uTimerID = 0;
void CALLBACK TestProc(UINT, UINT, DWORD, DWORD, DWORD);
typedef struct Test {
    int a;
    int b;
} Test;

// Called before the Win32 message loop begins
uTimerID = timeSetEvent(100, 10, (LPTIMECALLBACK)TestProc, (DWORD)&tTimer,
TIME_PERIODIC);

// The Timer Proc
void CALLBACK TestProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1,
DWORD dw2) {
        Test *tTimerData = (Test *)dw1;
        cout << tTimerData.a; // also tried with tTimerData '->'
didn't work
}

Can anyone tell me what's wrong here?



Relevant Pages

  • Timers?
    ... I'm a bit lost trying to setup a multimedia timer using the Win32 API - I'm ... void CALLBACK TestProc(UINT, UINT, DWORD, DWORD, DWORD); ... void CALLBACK TestProc(UINT wTimerID, UINT msg, DWORD dwUser, DWORD dw1, ...
    (comp.lang.cpp)
  • Re: problem using sdk
    ... //It's used to indicate the device where the SecBank is to be found ... SECBANKDLL_API UINT SB_CALLMODE SecBank_GetFirstPublic (DWORD ... UINT SB_CALLMODE SecBank_GetPrivate (DWORD IDSecBank, WORD IDEntry, ...
    (microsoft.public.vb.winapi)
  • Re: problem using sdk
    ... SECBANKDLL_API UINT SB_CALLMODE SecBank_GetFirstPublic (DWORD IDSecBank, ... //Insert a new Entry in the SecBank currentrly on RAM and returns ...
    (microsoft.public.vb.winapi)
  • Mangaged to Unmanaged code I2C device access violation issue
    ... in unmanged code in passing PBYTE pBufIn in the function below's signature. ... It is defined as a 4 byte array and the driver code casts this to a DWORD. ... BOOL bRet = FALSE; ... public static uint CTL_CODE(uint DeviceType, uint Function, uint ...
    (microsoft.public.dotnet.framework.interop)
  • Re: NotifyIconData versions
    ... Hwnd As Long ... UINT uFlags; ... CHAR szTip; ... DWORD dwState; ...
    (microsoft.public.vb.winapi)