Flash Player Activx Upgrade to version 26 is not working as expected
Hi we have legacy VC++ based product which embeds Flash player in it . It was using Flashplayer ActivX version 15.0 . After upgrading to 26.0 it is not working as expected .
(Generated tli and tlh files and used in my application)
I am getting access denied exception in this line
int m_csLevel = 67;
HRESULT hr = m_lpControl->LoadMovie (m_csLevel, CustomSWF);
Only if m_csLevel is 0 it is working file . Please let me know any other changes need to be done for upgrading from version 15 to version 26
Settings are as shown below
#define CFlashOle COleContainerWnd<ShockwaveFlashObjects::IShockwaveFlash>
//m_lpControl used to access IShockwaveFlash
bool COleFlashWnd::LoadCustomSWF (void)
{
// Custom.swf only works upto version 8
//
if (m_swfVersion > 😎
{
const char* info =
"<FlashInfo>"
" <EIAvailable>false</EIAvailable>"
" <CapVersion></CapVersion>"
" <SWFVersion></SWFVersion>"
"</FlashInfo>";
FSCommand ("Custom.Ready", info);
TraceMsg ("%s: Exit - SWF is version %d; spoofing call the FSCommand()", funcName, m_swfVersion);
return true;
}
// generate the name of the SWF
// which will be located in the application folder
//
char CustomSWF[MAX_PATH];
int n = ::GetModuleFileName (NULL, CustomSWF, sizeof(CustomSWF));
while (--n >= 0)
{
char c = CustomSWF
if (c == '\\' || c == '/' || c == ':') break;
}
strcpy (CustomSWF+n+1, "Custom.swf");
if (!Coolsign::FileUtils::FileExists (CustomSWF))
{
return false;
}
// load it at a non-root level
//
int m_csLevel = 67;
HRESULT hr = m_lpControl->LoadMovie (m_csLevel, CustomSWF);
if (FAILED (hr))
{
return false;
}
return true;
}
bool COleFlashWnd::OnInit (void)
{
const char* funcName = "COleFlashWnd::OnInit()";
m_flashVersion = m_lpControl->FlashVersion();
m_lpControl->PutEmbedMovie (VARIANT_TRUE);
m_lpControl->PutMenu (VARIANT_FALSE);
m_lpControl->DisableLocalSecurity();
m_lpControl->PutAllowNetworking (L"all");
m_lpControl->PutAllowScriptAccess (L"always");
m_lpControl->PutWMode (L"transparent");
m_lpControl->PutScale (L"showAll");
// connect up the event handler
//
hr = m_lpControl->QueryInterface (IID_IConnectionPointContainer, (void**)&m_lpConContainer);
if (FAILED (hr))
{
SetErrorMsg ("failed to connect event handler; querying for the container");
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
hr = m_lpConContainer->FindConnectionPoint (ShockwaveFlashObjects::DIID__IShockwaveFlashEvents, &m_lpConPoint);
if (FAILED (hr))
{
SetErrorMsg ("failed to connect event handler; querying for the connection");
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
hr = m_lpConPoint->Advise ((ShockwaveFlashObjects::_IShockwaveFlashEvents*)this, &m_dwConPointID);
if (FAILED (hr))
{
SetErrorMsg ("failed to connect event handler; installing callback");
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
// convert the given filename to an absolute filename
//
char absFilename[1024];
if (!_fullpath (absFilename, m_filename, sizeof(absFilename)))
{
SetErrorMsgf ("failed to resolve filename; %s", m_filename.c_str());
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
hr = m_lpOle->DoVerb (OLEIVERB_SHOW, NULL, (IOleClientSite*)this, 0, NULL, NULL);
if (FAILED (hr)) { SetErrorMsg ("DoVerb(OLEIVERB_SHOW) failed"); return false; }
m_lpControl->PutEmbedMovie (TRUE);
// Stage3D feature introduced in Flash Player 11 (desktop) [ SWF version 13]
//
if(!CFlashOle::IsTransparent() && m_swfVersion>=13)
m_lpControl->PutWMode (L"gpu");
// load the requested SWF file
//
hr = m_lpControl->LoadMovie (0, absFilename);
if (FAILED (hr))
{
SetErrorMsgf ("failed to load file; %s", absFilename);
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
long pctLoaded = m_lpControl->PercentLoaded();
if (pctLoaded == 0)
{
SetErrorMsgf ("failed to load file; %s, %d%% loaded", absFilename, pctLoaded);
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
// I don't want it to start playing right away
// of course, timeless SWFs will ignore the request
//
StopImp();
PutFrameNumImp (0);
PutLoopImp (false);
if (GetTotalFramesImp() != m_swfFrameCount)
{
SetErrorMsg ("misread header information");
TraceMsg ("%s: Exit - %s", funcName, m_errorMsg.c_str());
return false;
}
// set the initialize size of the control
//
if (!CFlashOle::ResizeImp (m_swfWidth, m_swfHeight))
{
TraceMsg ("%s: Exit - CFlashOle::Resize() failed", funcName);
return false;
}
// load the Custom ActionScript classes
//
if (!LoadCustomSWF())
{
TraceMsg ("%s: Exit - LoadCoolSignSWF() failed", funcName);
return false;
}
Also when i play in loop during replay . I am seeing some white flash for 100ms for few older files.
