CompuServe Thread

aaplay & VC++

1 messages in this thread
#132670From: LAM Chi-fungNov 1, 1994 1:10 PM
Hello I am now using Animation SDK with VC++, I would like to stop the animation when it finish one loop, I declare StopMsg and NotifyMsg and wMode as follow: static WORD StopMsg; static WORD NotifyMsg; static WORD wMode = AA_LOOPFRAME; and I put the following in views constructor: StopMsg = RegisterWindowMessage(AA_STOP); NotifyMsg = RegisterWindowMessage(AA_NOTIFY); and declare the following in the header file's message map: afx_msg LRESULT OnMyAniStop(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnMyAniNotify(WPARAM wParam, LPARAM lParam); and the following in the CPP file's message map: ON_REGISTERED_MESSAGE(StopMsg,OnMyAniStop) ON_REGISTERED_MESSAGE(NotifyMsg,OnMyAniNotify) and play the animation with the following code, since I want to stop the animation just after 1 loop, so I use 0x00010000 myAni=aaLoad("c:\\aa\\mrnumo.fli",CTestView::GetSafeHwnd(),wMode,0,0,0, ,0,0); aaNotify(myAni,0x00010000,10); aaPlay(myAni); below is OnMyAniNotify LRESULT CTestView::OnMyAniNotify(WPARAM wParam, LPARAM lParam) { if(lParam==10){ aaStop(myAni); aaUnload(myAni); aaClose(); } return 0L; } and below is OnMyAniStop: LRESULT CTestView::OnMyAniStop(WPARAM wParam, LPARAM lParam) { if(lParam != 0) AfxMessageBox("Stop error"); return 0L; } The manual said that the Stop message is not send if the animation is stopped by aaStop, however, the OnMyAniStop get call just after OnMyAniNotify and the lParam of the Stop message is not zero!!! (animation stop by error!!!) Why this happen ? Is my methd to stop animation right ? Also, in my case, do I need to cancel the Notify ? If so, how to do it ? Thanks. Regds LAM Chi-fung