COM Object with CLSID *** invalid...

maxter

Member
Joined
Mar 23, 2003
Messages
9
Hello,

Ive problems with one assembly. Im using and have referenced Microsoft.mshtml.dll, which is Primary Interop Assembly. Its in "D:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll".

Code:
Public Class Enlaces
    Private Enlace As mshtml.HTMLAnchorElement

    Public Sub New(ByVal e As mshtml.HTMLAnchorElement)
        Try
            Enlace = New mshtml.HTMLAnchorElement()
            Enlace = e
            AddHandler DirectCast(Enlace, mshtml.HTMLAnchorEvents2_Event).onclick, AddressOf EnlaceOnClick
        Catch exc As Exception
            MsgBox("Error en constructor de Enlace: " + exc.Message, MsgBoxStyle.Critical)
        End Try
    End Sub

    Private Function EnlaceOnClick(ByVal pEvtObj As mshtml.IHTMLEventObj) As Boolean
        Return True
    End Function

End Class

I debugged it, and the sentece "Enlace = new mshtml.HTMLAnchorElement()" raise the follow error:

"COM Objet with CLSID {3050F248-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered"

I tried register it, with command "regsvr32" but with this I cant register it, when I execute
regsvr32 "D:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll"

raise new error:

"D:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll was loaded, but the DllRegisterServer entry point was not found.

DllRegisterServer may not be exported, or a corrupt version of D:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll may be in memory. Consider using PView to detect and remove it"

Perhaps if is a assembly....so to register assemblies I use command
regasm "D:\Program Files\Microsoft.NET\Primary InteropAssemblies\Microsoft.mshtml.dll"

This go ok, but I cant resolve the problem. I dont know what is wrong, Im lose.

I found the CLSID in the registry with this values:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{3050F248-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32

Assembly: Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Class: mshtml.HTMLAnchorElementClass
CodeBase: file:///D:/Program Files/Microsoft.NET/Primary Interop Assemblies/Microsoft.mshtml.dll
RunTimeVersion: v1.0.3705

Please, help me.

Thanks.
 
A similar problem

Hi there... seems that its been a long time since your last post... anyway...

If you found a solution to the "COM object not valid or registered" error please tell me, Im in a similar situation.

Im programming in C# and get the same error when trying to use any class of the mshtml lybrary, the error occurs in lines of code where I try to create instances of the classes of this library using costructors.

HTMLAnchorElementclass a = new HTMLAnchorElementclass();

I found out that this line of code doesnt throw the ComException if the project output is not a dll, like in the following application:



The point is that I do need a dll as ouptut too...

Hope you can help me.
 
I think I got it

Hi, its me again.

I think I got the solution to the COMException.

Im using the DHTMLEdit control for IE5, and the IDE is Visual Studio 2003.

The DHTMLEdit control has an event called "DocumentComplete". Maybe this event occurs every time the controls finishes to parse and render its content. I added an event handler for this event and found out that the COMException wasnn thrown anymore, so I conclude that you cant use any class of the mshtml library when the control parses or renders its content.

I also found out that Microsoft will no longer update the DHTMLEdit control, and that the Beta 2 version of Visual Studio 2005 includes a WebBrowser control and a "kind of" DOM as part of its Windows.Form library. The WebBrowser control is available too in Visual Studio 2003, but you have to manually add it to your toolbox and it is part of other library. I found also information on how to make this control editable and how to replace the DHTMLEdit controls properties and methods with the ones of the WebBrowser control, but it seems that the DHTMLEdit control offers more powerfull features.

I dont know if you were using one of these controls and if you found the solution to your problem, I decided to post this for whoever gets this problem and find this forum.
 
Back
Top