|
|
SetTimer的函式是要如何定?呢
附上source code:\Players.zip
BGMusic 是
原程式from SamplesDX9b\C++\DirectShow\Players\BGMusic
VOID CALLBACK MyTimerProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime // current system time
)
{
SwapSourceFilter();
// Update the "current file" text message
RECT rc;
GetWindowRect(hwnd, &rc);
InvalidateRect(hwnd, &rc, TRUE);
}
HRESULT GraphInit(void)
{
if(!SetTimer(g_hwndApp, 0, MEDIA_TIMEOUT, (TIMERPROC) MyTimerProc))
return E_FAIL;
我?⑺??成依各??e可是?s出????
VOID CALLBACK CSongPlayer::MyTimerProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
DWORD dwTime // current system time
)
{
SwapSourceFilter();
// Update the "current file" text message
RECT rc;
GetWindowRect(hwnd, &rc);
InvalidateRect(hwnd, &rc, TRUE);
}
HRESULT CSongPlayer::GraphInit(void)
{
if(!SetTimer(g_hwndApp, 0, MEDIA_TIMEOUT, (TIMERPROC) CSongPlayer::MyTimerProc))
return E_FAIL;
??霈F以下??,是否要把MyTinerProc改成statuc function才可以解呢?
--------------------Configuration: BGMusic - Win32 Debug Unicode--------------------
Compiling...
SongPlayer.cpp
E:\Akira Tmp\SamplesDX9b\C++\DirectShow\Players\Ak -BGMusic\SongPlayer.cpp(86) : error C2440: 'type cast' : cannot convert from '' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
None of the functions with this name in scope match the target type
Error executing cl.exe.
bgmusic.exe - 1 error(s), 0 warning(s)
|
|