Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

HElp - ANIMATE_PLAY macros

isn-removed200637
728 Views
I found a nice example of playing an AVI clip in a dialog box on the MSDN/Visual Studio/ cd rom. It is a C program , animate.c, which I want to convert to a Fortran version using the GENERIC example as a basis.
I have got as far as getting the dialog box to open ok. I now find that I am unable to satisfy references to the WIndows macros ANIMATE_OPEN, ANIMATE_PLAY, ANIMATE_SEEK etc. From the infoviewer, I am referred to COMMCTRL.H as the place to find them. I do not have Visual C on my machine. Can anyone please point me to where they might exist within the Visual Fortran resources? TIA
0 Kudos
5 Replies
Jugoslav_Dujic
Valued Contributor II
728 Views
Most of "helper macros" are not implemented by Compaq. "Helper macros" are actually various wrappers for SendMessage intended to make code more readable. So, you could either use SendMessage instead (with ACM_OPEN, ACM_PLAY, ACM_SEEK) or write your own wrappers.

Jugoslav
0 Kudos
isn-removed200637
728 Views
Yes, thanks Jugoslav. I downloaded the SDK and found the macros in COMMCTRL.H and figured out the SendMessage
link. However, When I used Resource Editor to include an animation control in the dialog box, the dialog refuses to load
(DialogBoxParam returns -1). If I replace it with another control,such as an edit box, the dialog loads OK.


The resource script created for the control is as follows:

  
ANIMATEDLG DIALOG DISCARDABLE  50, 50, 304, 146  
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU  
CAPTION "Animation Demo"  
FONT 8, "MS Sans Serif"  
BEGIN  
  
    DEFPUSHBUTTON   "Quit",IDOK,223,122,50,14  
    PUSHBUTTON      "Play",IDC_PLAY,22,122,49,14  
    PUSHBUTTON      "Stop",IDC_STOP,89,122,49,14  
    PUSHBUTTON      "Seek",IDC_SEEK,156,122,49,14  
    CONTROL         "Animate1",IDC_EDIT1,"SysAnimate32",ACS_CENTER |   
                    WS_BORDER | WS_TABSTOP,18,7,266,102  
END  

Any Ideas?

0 Kudos
Jugoslav_Dujic
Valued Contributor II
728 Views
You have to call InitCommonControls or maybe even
InitCommonControlsEx(T_INITCOMMONCONTROLSEX(8, ICC_ANIMATE_CLASS))
somewhere at the start.
0 Kudos
isn-removed200637
728 Views
Many thanks again, Jugoslav, for your tip which worked.
I added the following to WinMain:
 
interface 
subroutine InitCommonControls ()  
!DEC$ IF DEFINED(_X86_) 
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_InitCommonControls@0' :: InitCommonControls 
!DEC$ ELSE 
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'InitCommonControls'    :: InitCommonControls 
!DEC$ ENDIF 
end subroutine InitCommonControls 
end interface 
call InitCommonControls() 

and added comctl32.lib to the library search step in the project Link settings
(I added Fullapi.f90 to the project, but that is missing comctl32.lib - maybe I will add
the appropriate !dec$objcomment lib:"comctl32.lib" comment to it for future reference). Again, many thanks.
0 Kudos
isn-removed200637
728 Views
By the way Jugoslav, while programming in a call to GetOpenFileNAme to select files to be played in the animation control, I have discovered GetOpenFilenamePreview which, when
set up with an .AVI filter opens a preview pane in the Explorer dialog. It has succeded in previewing/playing every .AVI file I found on my PC, wheras only three of them were playable in the animate control.
0 Kudos
Reply