Friday, September 27, 2013

Invalid class string Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

Dear Sir or Mam,


i think i have a very 'special' problem regarding 0x800401F3.


I'm trying to execute the following code:




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

namespace PublishingPointTester
{
public partial class Form1 : Form
{

// Declare variables.
WMSServer Server;
IWMSBroadcastPublishingPoint BCPubPoint;
IWMSPublishingPoints PubPoints;
IWMSPublishingPoint PubPoint;
Type tServerType;
WMSServer RemoteServer;

public Form1()
{
InitializeComponent();


try
{
Type tServerType = Type.GetTypeFromProgID("WMSServer.Server.9", true);

// Create a new WMSServer object.
// Server = new WMSServer();

RemoteServer = (WMSServer)Activator.CreateInstance(Server.GetType());

// Retrieve the IWMSPublishingPoints object.
PubPoints = RemoteServer.PublishingPoints;

// Retrieve each publishing point and retrieve the
// IWMSBroadcastPublishingPoint object.
for (int i = 0; i < PubPoints.Count; i++)
{
PubPoint = PubPoints[i];

if (PubPoint.type ==
WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST)
{
BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

// Retrieve the current status of the publishing point.
// The status is reported as the result of a bitwise OR
// of any of the designated values.
WMS_BROADCAST_PUBLISHING_POINT_STATUS ppsStatus;
ppsStatus = BCPubPoint.BroadcastStatus;

// If the publishing point is currently stopped, start it.
if (ppsStatus == WMS_BROADCAST_PUBLISHING_POINT_STATUS.WMS_BROADCAST_PUBLISHING_POINT_STOPPED)
{
MessageBox.Show("Publishing Point gestoppt!!!");
}
break;
}
}
}
catch (COMException comExc)
{
textBox1.Text = comExc.ToString();
}
catch (Exception e)
{
textBox1.Text = e.ToString();
}
}
}
}

When this function is called i get the error:



Type tServerType = Type.GetTypeFromProgID("WMSServer.Server.9", true);

It gives me the HRESULT: 0x800401F3. Now there are different aproaches to solve this problem in the forums. I've looked in the registry and WMSServer.Server.9 should be registered correctly.


Here the Values:



HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6} : (Standard) REG_SZ Windows Multimedia Service Center

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6} : AppID REG_SZ {A2EFA5CB-3B0E-11D2-9EFD-006097D2D7CF}

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6}\ProgID : (Standard) REG_SZ WMSServer.Server.9

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6}\Programmable : (Standard) REG_SZ (no value)

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6}\TypeLib : (Standard) REG_SZ {D71E02C2-41EF-11D2-BF23-00805FBE84A6}

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6}\Version : (Standard) REG_SZ 9.0

HKEY_CLASSES_ROOT\CLSID\{845FB959-4279-11D2-BF23-00805FBE84A6}\VersionIndependentProgID : (Standard) REG_SZ WMSServer.Server

I'm using Visual Studio 2010 Ultimate X64 on a Windows 2008 Enterprise Server with installed IIS and Streaming Media-Services.


Any help would be greatly appreciated.Thanks in advance


Edit: I've tried to run Visual Studio with administrator privileges but the problem exists further.



No comments:

Post a Comment