|
See also: SWF Scout library is an ActiveX programming library for SWF flash movies generation library from Visual C++, Visual Basic, Visual Basic.NET, ASP and ASP.NET. Can use existing SWF flash movies as templates for new flash movie generation. SWF SlideShow Scout library is an ActiveX/NET-compatible programming library for generating eye-catching flash (swf) slideshow movies SWF To Image library is a freeware ActiveX programming library that can convert SWF to BMP or JPEG image from Visual C++, Visual Basic, Visual Basic.NET, ASP and ASP.NET |
Tutorial: How to display Flash animation in Visual C++ MFC application You can download the source code of this example here: vc_how_to_display_flash.zip On this page you will find step-by-step tutorial on how to display flash (SWF) animation file in your Visual C++ application. We will make VC++ application that will display Shapes.swf flash animation previously generated using our SWF Scout library (click here for "Shapes" example). Start Visual C++ 6.0 wizard, select type and name of new MFC application project:
Click OK to start MFC Application Wizard:
Select Dialog based project type and click Next. Next page will appear:
Click Finish to create new project. Visual C++ IDE will display summary information for new project:
Click OK to open new dialog based project in VC++ IDE:
Now we should import Shockwave ActiveX control to controls toolbar. Go to Project menu, select Add To Project sub-menu and then click Components and Controls... command:
Visual C++ will display "Components and Controls Gallery" dialog:
Click on "Registered ActiveX Controls" to display list of available ActiveX controls:
Find and select Shockwave Flash Object ActiveX control in the list of available controls and click "Insert" to add this control to controls toolbar. VC will generate special C++ class that will help to interact with this control:
Click OK and VC will generate new "CShockwaveFlash" class in ShockwaveFlash.cpp and ShockwaveFlash.h files. "Shockwave Flash Object" control will appear on controls toolbar:
Click on "Shockwave Flash Object" icon and then click on dialog form. Answer "OK" to add new component to dialog:
New control will be added as shown below :
Now we will add dialog class member that will handle Flash control. Right-click on dialog and select "Class Wizard" to invoke Class Wizard:
Class Wizard dialog will appear. Select Member Variables tab and click Add Variable... button to add new variable:
Enter name of new varaible: m_FlashPlayer and click OK:
New click OK to close MFC ClassWizard:
Now we will place code that will load "Shapes.swf" into flash player control. Right-click on dialog form and select "Events.." to invoke Events dialog:
Select and double-click on WM_INITDIALOG caption as shown on screenshot below:
Code Editor window will appear. CDisplayFlashDlg::OnInitDialog() function is responsible for handling initialization code so we will add our code here.
Add this line : m_FlashPlayer.SetMovie("c:\shapes.swf"); as shown on screenshot below:
And run application by pressing F5 or using Build menu:
You will see application that will display Shapes.SWF flash movie using Shockwave Flash Object ActiveX control:
You can download the source code of this example here: vc_how_to_display_flash.zip
If you want to display Flash using Shockwave Flash Object ActiveX in non-dialog based application please check these topics:
See also: SWF Scout library SWF Scout library is an ActiveX programming
library for SWF flash movies generation library from Visual C++, Visual
Basic, Visual Basic.NET, ASP and ASP.NET. Can use existing SWF flash
movies as templates for new flash movie generation. |
||
|
Copyright © ByteScout, 2003-2009. Privacy Statement
Microsoft®, Windows®, Windows 2000®, Windows Server®, Windows Vista®, Internet Explorer®, .NET Framework®, ActiveX®, Visual Basic®, Visual C#®, ASP®, ASP.NET®, Excel®, PowerPoint®, are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Adobe®, Flash® and Acrobat® are registered trademarks of Adobe Systems, Incorporated. Mozilla®, Firefox® and the Mozilla and Firefox Logos are registered trademarks of the Mozilla Foundation. Other product names or brandnames used herein are for identification purposes only and might be trademarks or registered trademarks of their respective companies. We disclaim any and all rights to those marks. |
|||