calling with a button:
Code: Select all
void CSample01_SWF_And_FLV_PlayerDlg::InvokeGetMyVariable()
{
//InvokeGetVariable(m_hwndFlashPlayerControl, _T("MyArray"));
//InvokeTGetProperty(m_hwndFlashPlayerControl, _T("MyArray"), 0);
//InvokeTGetProperty(m_hwndFlashPlayerControl, _T("MyArray"), 1);
//InvokeTGetPropertyAsNumber(m_hwndFlashPlayerControl, _T("MyArray"), 0);
//InvokeTGetPropertyAsNumber(m_hwndFlashPlayerControl, _T("MyArray"), 1);
GetFlashVars(m_hwndFlashPlayerControl, _T("MyArray"));
}
code taken from your help section
Code: Select all
void InvokeGetVariable(HWND hwndFlashPlayerControl, LPCTSTR name)
{
SFPCGetVariable info;
info.name.lpszBuffer = name;
info.Result.lpszBuffer = NULL;
::SendMessage(hwndFlashPlayerControl, FPCM_GETVARIABLE, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("MEGA-ERROR"), MB_OK);
return;
}
info.Result.lpszBuffer = (TCHAR*)LocalAlloc(LPTR, info.Result.dwBufferSize * sizeof(TCHAR));
::SendMessage(hwndFlashPlayerControl, FPCM_GETVARIABLE, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("ERROR"), MB_OK);
}
else
// OK
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("Result"), MB_OK);
}
LocalFree((HLOCAL)info.Result.lpszBuffer);
}
void InvokeTGetProperty(HWND hwndFlashPlayerControl, LPCTSTR target, int property)
{
SFPCTGetProperty info;
info.target.lpszBuffer = target;
info.property = property;
info.Result.lpszBuffer = NULL;
::SendMessage(hwndFlashPlayerControl, FPCM_TGETPROPERTY, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("MEGA-ERROR"), MB_OK);
return;
}
info.Result.lpszBuffer = (TCHAR*)LocalAlloc(LPTR, info.Result.dwBufferSize * sizeof(TCHAR));
::SendMessage(hwndFlashPlayerControl, FPCM_TGETPROPERTY, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("ERROR"), MB_OK);
}
else
// OK
{
::MessageBox(NULL, info.Result.lpszBuffer, _T("Result"), MB_OK);
}
LocalFree((HLOCAL)info.Result.lpszBuffer);
}
void GetFlashVars(HWND hwndFlashPlayerControl, LPSTR FlashVars)
{
SFPCGetFlashVars info;
info.lpszBuffer = FlashVars;
::SendMessage(hwndFlashPlayerControl, FPCM_GET_FLASHVARS, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, NULL, _T("MEGA-ERROR"), MB_OK);
return;
}
info.lpszBuffer = (TCHAR*)LocalAlloc(LPTR, info.dwBufferSize * sizeof(TCHAR));
::SendMessage(hwndFlashPlayerControl, FPCM_GET_FLASHVARS, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, NULL, _T("ERROR"), MB_OK);
}
else
// OK
{
::MessageBox(NULL, info.lpszBuffer, _T("Result"), MB_OK);
}
LocalFree((HLOCAL)info.lpszBuffer);
}
void InvokeTGetPropertyAsNumber(HWND hwndFlashPlayerControl, LPCTSTR target, int property)
{
SFPCTGetPropertyAsNumber info;
info.target.lpszBuffer = target;
info.property = property;
::SendMessage(hwndFlashPlayerControl, FPCM_TGETPROPERTYASNUMBER, 0, (LPARAM)&info);
if FAILED(info.hr)
// Error
{
::MessageBox(NULL, NULL, _T("MEGA-ERROR"), MB_OK);
}
else
// OK
{
TCHAR lpszBuffer[1024];
wsprintf(lpszBuffer, _T("%d"), info.Result);
::MessageBox(NULL, lpszBuffer, _T("Result"), MB_OK);
}
}
MyArray is a global variable in my .swf file initialised in frame1.
Code: Select all
public var MyArray:Array;
how can i get it in my C++ application?