Run without installed Flash ActiveX
Traditionally, applications using Macromedia / Adobe Flash Player ActiveX required swflash.ocx
or flash.ocx
to be installed and registered in the system.
This caused several issues:
- The control fails if Flash ActiveX is missing.
- The application depends on the version already installed.
- Flash movies cannot be easily protected from unauthorized use.
After Flash EOL (End of Life, December 2020), most systems no longer have Flash ActiveX installed, as its use is discouraged and the control is typically removed.
F-IN-BOX solves this problem by allowing applications to bundle and load the Flash ActiveX control code directly from resources or files, without installation or registration.
This approach ensures your Flash-enabled application continues to run even when Flash is not present on the system.
To achieve this, use the function FPC_LoadOCXCodeFromMemory, which loads the Flash ActiveX control directly from a memory block.
Example: Load from a resource
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 handling
}
Example: Load from a file
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 handling
}
UnmapViewOfFile(lpFlashOCXCodeData);
CloseHandle(hFileMapping);
CloseHandle(hFile);