tags:

views:

455

answers:

1

As part of a customized media player written in C (Win32), I need to enable my app play flash movies (.swf files) inside the player window. Can someone please indicate the most C compatible low level way to achieve this, giving me highest control? Specially control on display window and network access.

I am looking for reference to a Windows DLL like flash_player.dll (if there is such thing) with documentation. Or at least a COM/ActiveX controls. Note that ActiveX is harder to use in C, than in say VB.

+4  A: 

Used code from: http://support.microsoft.com/kb/218442/EN-US/

//*Place at the top of your CAxDialogImpl class
#import "flash.ocx" rename_namespace( "FLASH")
FLASH::IShockwaveFlashPtr m_spFlash;


//This code gets added to your OnInitDialog function of the window
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
CAxWindow wnd;
CLSID clsid;
LPUNKNOWN pUnkCtrl, pUnkCont;
HRESULT hr = CLSIDFromString(OLESTR("{D27CDB6E-AE6D-11CF-96B8-444553540000}"), &clsid);
hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_IUnknown,
(void**)&pUnkCtrl);
CComQIPtr <IPersistStreamInit> spPerStm(pUnkCtrl);
spPerStm->InitNew();

m_spFlash = pUnkCtrl;
wnd.Attach(m_hWnd);
wnd.AttachControl(pUnkCtrl, &pUnkCont);

m_spFlash->PutMovie( _bstr_t(_T("C:\\Documents and Settings\\murk\\Desktop\\Chlorine\\ccc_main.swf")));
}
joe
-1, C++ not C. C has no classes nor methods.
MSalters
Anyway good info, if it works in C++, I can probably convert it into C.
CDR
Oh man, COM in pure C . . . not nice. Possible, but pointers fly everywhere.
dreamlax
+1 It is C++ code, but it does contain enough information for the original poster to make progress.
DavidK