Quick links:
F-IN-BOX DLL Edition Home Page
| Buy license
| Welcome to our forum!
| Ask your question
| Help on the Web
F-IN-BOX DLL Edition Help >> How to Embedding swflash.ocx/flash.ocx code into application
Traditionally, there are many obstacles or annoyances that one will encounter when using Macromedia Flash Player ActiveX in an application. The Application...
F-IN-BOX to the rescue. It solves these problems and more! By default, the component will use the swflash.ocx/flash.ocx that's already installed on the system. The component can alternatively use any swflash.ocx/flash.ocx that you would like to provide it with using any supported source. An example of this how you can embed the flash.ocx into the resource section of your application's exe file and then load it at runtime. Using this method, your application will work even if the Macromedia Flash Player ActiveX doesn't exist on the target system. Just use FPC_LoadOCXFromMemory function! With F-IN-BOX, hassling around with Macromedia Flash Player ActiveX installation issues are a thing the past! It's so easy to do! There are even demos provided which come complete with source code to prove it! Here's an example of how to load swflash.ocx/flash.ocx code from a resource: [ C++ ]
HMODULE hModule = GetModuleHandle(NULL); HRSRC hResInfo = FindResource(hModule, _T("FLASHOCXCODE"), _T("BIN")); HGLOBAL hResData = LoadResource(hModule, hResInfo); LPVOID lpFlashOCXCodeData = LockResource(hResData); DWORD dwFlashOCXCodeSize = SizeofResource(hModule, hResInfo); HFPC hFPC = FPC_LoadOCXFromMemory(lpFlashOCXCodeData, dwFlashOCXCodeSize); if (NULL == hFPC) { // Error } Here's an example of how to load the swflash.ocx/flash.ocx code from a file: [ C++ ]
HANDLE hFile = CreateFile(_T("flash.ocx"), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); DWORD dwFlashOCXCodeSize = GetFileSize(hFile, NULL); HANDLE hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, dwFlashOCXCodeSize, NULL); LPVOID lpFlashOCXCodeData = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0); HFPC hFPC = FPC_LoadOCXFromMemory(lpFlashOCXCodeData, dwFlashOCXCodeSize); if (NULL == hFPC) { // Error } UnmapViewOfFile(lpFlashOCXCodeData); CloseHandle(hFileMapping); CloseHandle(hFile); Copyright © Softanics. All rights reserved. F-IN-BOX is a trademark of Softanics. Macromedia and Shockwave Flash are trademarks of Adobe
Quick links:
F-IN-BOX DLL Edition Home Page
| Buy license
| Welcome to our forum!
| Ask your question
| Help on the Web
|