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.
Amsterdam.

__________________________________________________________________
Sample Code:
__________________________________________________________________

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

public:
 CAnimateCtrl a_test;

__________________________________________________________________
In some function:
__________________________________________________________________
{
 DWORD m_dwStyle;
 m_dwStyle = WS_VISIBLE|WS_CHILD|ACS_CENTER|ACS_AUTOPLAY;
// m_dwStyle = WS_VISIBLE|WS_POPUP|WS_CAPTION|WS_SYSMENU;

 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 ,
IDC_ANIMATE))
 {
  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");
 }

Quote:
}

__________________________________________________________________
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;
InitInstance();
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