Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

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;
            }

        }
    }
}
Posted
Updated 14-Mar-10 3:50am
v2

1 solution

The first thing I'd do is make sure you code is being compiled x86 instead of Any CPU.

You cannot combine both 32-bit and 64-bit code in the same process.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900