Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I've problems with one assembly. I'm using and have referenced Microsoft.mshtml.dll, which is Primary Interop Assembly. It's in "D:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll".

 

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 can't 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 can't resolve the problem. I don't know what is wrong, I'm 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.

  • 2 years later...
Posted

A similar problem

 

Hi there... seems that it's 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, I'm in a similar situation.

 

I'm 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 doesn't 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.

Posted

I think I got it

 

Hi, it's me again.

 

I think I got the solution to the COMException.

 

I'm 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 wasn'n thrown anymore, so I conclude that you can't 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 control's properties and methods with the ones of the WebBrowser control, but it seems that the DHTMLEdit control offers more powerfull features.

 

I don't 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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...