CWnd, CAnimateCtrl: Window won't open, display or activate 
Author Message
 CWnd, CAnimateCtrl: Window won't open, display or activate

When opening a window (CWnd or AnimateCtrl), the window is displayed
but it does not function as a normal window. It behaves as a sort of
"screenshot" window.

Calling ShowWindow, makes the window disappear again. In the case
of AnimateCtrl, calling Open("file.avi") gives an error. This gives me
the idea the window is not really created on the other hand, calling
the same code twice gives a runtime error.

I am sure I am doing something very simple wrong.

Can anyone help me? Sample code listed below.

Kind regards,
Robert de Geus.

Sample Code:

In the class definition (either a CWnd or CWinApp derived class):

 CAnimateCtrl a_test;

In some function:
 DWORD m_dwStyle;

 CString className = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW);

 // The window appears as a grey square:
 if( !a_test.Create(m_dwStyle, CRect(50,50,500,300), m_pMainWnd ,
  AfxMessageBox("Error Create");
// a_test.ShowWindow(SW_SHOW); // Would make the window vanish
// a_test.UpdateWindow();
 if ( !a_test.Open("D:\\sample.avi") )
  AfxMessageBox("Error Open");
 if ( !a_test.Play(0, -1, -1))
  AfxMessageBox("Error Play");


P.S. in the case of a CWnd derivced class (e.g. CFrameWnd):

a_test.Create(m_dwStyle, CRect(50,30,500,300), this , IDC_ANIMATE)

This code has been called in al sorts of thinkable ways and places:

In the constructor;
or a seperate function which is called through a menu.

Thu, 03 Aug 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. CWnd, CAnimateCtrl: Window won't open, display or activate

2. CAnimateCtrl: Avi file won't display

3. Child Windows won't activate

4. AVI clip won't play transparently in CAnimateCtrl

5. Activating a CWnd child window of a CView

6. CAnimateCtrl.Open fails, can't see why.....

7. CWnd won't dispatch custom message

8. How to write function which 's called when main window is activated

9. SIP - I'm not able to activate the SIP window

10. dialog won't open

11. Help! NMAKE won't display compile errors

12. CListCtrl won't display subitems in their columns


Powered by phpBB® Forum Software