Re: Pointers... again... f-n noobs...
From: Jarmo (jarmo_at_jarmo.com)
Date: 03/27/04
- Next message: Rappy: "accessing private member from different class"
- Previous message: Jordan Greenberg: "Re: I am utterly helpless"
- In reply to: TheEngine: "Pointers... again... f-n noobs..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Mar 2004 21:45:04 -0500
"TheEngine" <zmengine@shaw.ca> wrote in message
news:qOZ8c.13027$R27.11563@pd7tw2no...
> 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?
Plenty of example on the web. Looks like dw1 and dw2 are reserved and
should not be used. You should be using dwUser to retrieve your user data
(Test *tTimerData).
- Next message: Rappy: "accessing private member from different class"
- Previous message: Jordan Greenberg: "Re: I am utterly helpless"
- In reply to: TheEngine: "Pointers... again... f-n noobs..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|