I'm trying to load a flv from a file and somehow it does not work. Here is the code I'm using:
Code: Select all
CString strFlashMoviePath = dlg.GetPathName();
if (0 == dlg.GetFileExt().CompareNoCase(_T("swf")))
{
//
TCHAR lpszFlashMoviePath[MAX_PATH + 1] = { 0 };
lstrcpy(lpszFlashMoviePath, strFlashMoviePath);
//
SFPCPutMovie SFPCPutMovie;
SFPCPutMovie.lpszBuffer = lpszFlashMoviePath;
::SendMessage(g_hwndFlashPlayerControl, FPCM_PUT_MOVIE, 0, (LPARAM)&SFPCPutMovie);
}
else
{
CString strFlashVars = _T("FLVPath=");
strFlashVars += strFlashMoviePath;
FPC_PutFlashVars(g_hwndFlashPlayerControl, strFlashVars);
HMODULE h = GetModuleHandle(NULL);
ret = FPCPutMovieFromResource(g_hwndFlashPlayerControl, h, _T("FLVPlayer"), _T("SWF"));
}
I really don't have any clue of what's wrong, FPCPutMovieFromResource just returns FALSE. (the OCX seems to be registered correctly because it plays swf files),
Thanks,
/C.