I created (and used) a Windows Media Encoder object in Microsoft Visual C# 2008 Express Edition on MS Server 2003 64 bit. This worked fine.
However, when I attempted to create the equivalent Windows Media Encoder object using Microsoft Visual Web Developer 2008 on MS Server 2003 64 bit, the following exception was thrown:
"Retrieving the COM class factory for component with CLSID {632B606A-BBC6-11D2-A329-006097C4E476} failed due to the following error: 80040154."
It cannot be that the component isn’t registered, because both have a reference to the same WMEncEng.dll file. The Microsoft Visual Web Developer 2008 code also worked fine on XP 32 bit.
Could it be a problem with permissions? Regardless, anyone have any ideas why this problem is occurring and, more importantly, how to resolve it?
Thank you.
Here are the two code snippets from MS Server 2003 64 bit:
Microsoft Visual Web Developer 2008 (did not work):
using System;
using WMEncoderLib;
namespace TestWMEnc
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
WMEncoder encoder = new WMEncoder(); //exception thrown
// ...
}
catch (Exception err)
{
string exception = err.Message;
}
}
}
}
Microsoft Visual C# 2008 Express Edition (worked fine):
using System;
using System.Windows.Forms;
using WMEncoderLib;
namespace testWMEncoder
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
WMEncoder encoder = new WMEncoder();
// ...
}
catch (Exception err)
{
string exception = err.Message;
}
}
}
}
I get this error at "WMEncoder encoder = new WMEncoder();" with code compiled for a x86 target but running on a x64 system. Try to set the target system in VWD to "Any CPU" if possible.