I am developing a window based application in C#.net. In this app i have to sync between flash and c#. For this i have added Shockwaveflashobjects.dll from com component.

I got idea of this via this topic

Now when i am make a call from c# to flash it gives me error like this

Error HRESULT E_FAIL has been returned from a call to a COM component.

Is there any solution for this error ????

Thanks in advance


so you want to play flash file (swf) in c# form. right?

yes i want to play swf from c# and also i want to sync between flash and c# like i can call a function of c# from flash and viceversa
so when i am calling flash function from c# it gives me error

Error HRESULT E_FAIL has been returned from a call to a COM component.

do you now about this problem??

Use Shockwave Flash Object.
Right Click on control toolbar -> Add/Remove Item -> Select for Com Components Tab then chose for Shockwave flash object.
it will shown on your control toolbar (last control), use it like others control and add this following code (i also use open dialog control)
This following code will play .swf file :

private void button1_Click(object sender, System.EventArgs e)
	openFileDialog1.Filter = "swf File|*.swf";
	openFileDialog1.FilterIndex = 2;
	if (openFileDialog1.ShowDialog() == DialogResult.OK)
		axShockwaveFlash1.Movie = openFileDialog1.FileName;
		//lblFilePath.Text = openFileDialog1.FileName;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.