Does this COM dll look unregistered?
-
Because it doesn't to me. Exception:---------------------------------------------------------------------------------- An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Test Form exe Additional information: COM object with CLSID {3050F48A-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered. From Registry:------------------------------------------------------------------------------ [HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32] "Class"="mshtml.CEventObjClass" "Assembly"="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "RuntimeVersion"="v1.0.3705" [HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32\7.0.3300.0] "Class"="mshtml.CEventObjClass" "Assembly"="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "RuntimeVersion"="v1.0.3705" From Gacutil /L: (GAC)---------------------------------------------------------------------- Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null And Finally my own investigation of 3050f48a-98b5-11cf-bb82-00aa00bdce0b using--------------------------- Dim csCEventObjCLASS As New Guid("3050F48A-98B5-11CF-BB82-00AA00BDCE0B") Dim C_CEventObjCLASS As Type = Type.GetTypeFromCLSID(csCEventObjCLASS, True) CLASSName mshtml.CEventObjClass IsClass) TRUE IsCOMObject) TRUE IsInterface) FALSE IsPointer) FALSE Namespace) mshtml Module) MSHTML.dll Name) CEventObjClass GUID) 3050f48a-98b5-11cf-bb82-00aa00bdce0b Assembly) Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Assembly.Location) c:\winnt.0\assembly\gac\microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\microsoft.mshtml.dll Assembly.CodeBase) file:///c:/winnt.0/assembly/gac/microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/microsoft.mshtml.dll Assembly.GlobalAssemblyCache) TRUE Assembly.FullName) Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Assembly.GetCallingAssembly) System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Assembly.GetEntryAssembly) Test Form Focus, Version=1.0.1434.13227, Culture=neutral, PublicKeyToken=null Assembly.GetExecutingAssembly) Test Form Focus, Version=1.0.1434.13227, Culture=neutral, PublicKeyToken=null Assembly.GetExportedTypes) System.Type[] Assembly.GetFiles) System.IO.FileStream[] Assembly.GetLoadedModules) System.Reflection.
-
Because it doesn't to me. Exception:---------------------------------------------------------------------------------- An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Test Form exe Additional information: COM object with CLSID {3050F48A-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered. From Registry:------------------------------------------------------------------------------ [HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32] "Class"="mshtml.CEventObjClass" "Assembly"="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "RuntimeVersion"="v1.0.3705" [HKEY_CLASSES_ROOT\CLSID\{3050F48A-98B5-11CF-BB82-00AA00BDCE0B}\InprocServer32\7.0.3300.0] "Class"="mshtml.CEventObjClass" "Assembly"="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "RuntimeVersion"="v1.0.3705" From Gacutil /L: (GAC)---------------------------------------------------------------------- Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null And Finally my own investigation of 3050f48a-98b5-11cf-bb82-00aa00bdce0b using--------------------------- Dim csCEventObjCLASS As New Guid("3050F48A-98B5-11CF-BB82-00AA00BDCE0B") Dim C_CEventObjCLASS As Type = Type.GetTypeFromCLSID(csCEventObjCLASS, True) CLASSName mshtml.CEventObjClass IsClass) TRUE IsCOMObject) TRUE IsInterface) FALSE IsPointer) FALSE Namespace) mshtml Module) MSHTML.dll Name) CEventObjClass GUID) 3050f48a-98b5-11cf-bb82-00aa00bdce0b Assembly) Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Assembly.Location) c:\winnt.0\assembly\gac\microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\microsoft.mshtml.dll Assembly.CodeBase) file:///c:/winnt.0/assembly/gac/microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/microsoft.mshtml.dll Assembly.GlobalAssemblyCache) TRUE Assembly.FullName) Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a Assembly.GetCallingAssembly) System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Assembly.GetEntryAssembly) Test Form Focus, Version=1.0.1434.13227, Culture=neutral, PublicKeyToken=null Assembly.GetExecutingAssembly) Test Form Focus, Version=1.0.1434.13227, Culture=neutral, PublicKeyToken=null Assembly.GetExportedTypes) System.Type[] Assembly.GetFiles) System.IO.FileStream[] Assembly.GetLoadedModules) System.Reflection.
I don't think it's a matter of registration. After all Microsoft.mshtml is the interop assembly for InternetExplorer's mshtml.dll, and this wasn't registered Internet Explorer wouldn't work. This exception can be thrown more about an interop issue (bad use of objects or interfaces, or even if the object inside is not yet initialized. When I had this kind of issues last year, I tried adding code to my code sequence (even with stupid method calls) only to make sure the underlying objects were initialized and valid. Good luck!
-
I don't think it's a matter of registration. After all Microsoft.mshtml is the interop assembly for InternetExplorer's mshtml.dll, and this wasn't registered Internet Explorer wouldn't work. This exception can be thrown more about an interop issue (bad use of objects or interfaces, or even if the object inside is not yet initialized. When I had this kind of issues last year, I tried adding code to my code sequence (even with stupid method calls) only to make sure the underlying objects were initialized and valid. Good luck!
Hi Stephane, Yes it is Interop but isn’t the underlying code in MSTHML.dll? Or am I missing something? The statement is also so simple. Dim objevent As New CEventObj() Of interest when I create a Console.WriteLine(objevent.returnValue), property in the CeventObjClass, Studio based on the dim does not complain and shows me the correct object list to select .returnValue from the class. Thanks, GregC
-
Hi Stephane, Yes it is Interop but isn’t the underlying code in MSTHML.dll? Or am I missing something? The statement is also so simple. Dim objevent As New CEventObj() Of interest when I create a Console.WriteLine(objevent.returnValue), property in the CeventObjClass, Studio based on the dim does not complain and shows me the correct object list to select .returnValue from the class. Thanks, GregC
-
Hi Stephane, Yes it is Interop but isn’t the underlying code in MSTHML.dll? Or am I missing something? The statement is also so simple. Dim objevent As New CEventObj() Of interest when I create a Console.WriteLine(objevent.returnValue), property in the CeventObjClass, Studio based on the dim does not complain and shows me the correct object list to select .returnValue from the class. Thanks, GregC
gregcost wrote: Yes it is Interop but isn’t the underlying code in MSTHML.dll? Exactly. Interop issues can be one of these, in order of importance :
- underlying (unmanaged) object not initialized
- bad parameter or interface marshalling
- security, access denied
In your case, if could be an interop issue, but it could just be that the object you are using is lacking a context. I have just taken a look at mshtml.dll, and CEventObj is an interface, not an object. So you will never successfully create an instance of CEventObj (it's a pity that they have given it such a name). The implementation for the interface is CEventObjClass. Creating an instance of CEventObjClass should work better. That being said, I think it's best to stick with an existing sample. By default, I wouldn't pledge that you can create a useful and relevant instance of CEventObjClass by yourself. Most of the time with mshtml.dll, what you do is "get" objects down from the current document object. Your code might be ok, I don't know though.
-
gregcost wrote: Yes it is Interop but isn’t the underlying code in MSTHML.dll? Exactly. Interop issues can be one of these, in order of importance :
- underlying (unmanaged) object not initialized
- bad parameter or interface marshalling
- security, access denied
In your case, if could be an interop issue, but it could just be that the object you are using is lacking a context. I have just taken a look at mshtml.dll, and CEventObj is an interface, not an object. So you will never successfully create an instance of CEventObj (it's a pity that they have given it such a name). The implementation for the interface is CEventObjClass. Creating an instance of CEventObjClass should work better. That being said, I think it's best to stick with an existing sample. By default, I wouldn't pledge that you can create a useful and relevant instance of CEventObjClass by yourself. Most of the time with mshtml.dll, what you do is "get" objects down from the current document object. Your code might be ok, I don't know though.
Hi Stephane, Sorry, yes the dim I wrote as I was writing the message is the interface, I left off the Class suffix. I have tried it a bunch of different ways Dim objevent As New CEventObjClass() Dim objevent As New mshtml.CeventObjClass In fact none of the classes will work in the dll. I get the same COMException for any I try. What I’m actually trying is to get MS Knowledge Base Article 279535 to work. The short program uses a property in the class CEeventObjClass to disable script error checking for forms hosting a WebBrowser control. For whatever reasons Microsoft did not implement this disabling script feature for WebBrowser controls by selecting it from IE (even through it is really the same object). It is available for IE. So they supply you with a code example in VB6 not VB.net to address this problem. Actually I can understand why they did it this way because you might want to disable script error checking for IE but not completely across any applications that host Web controls on the same system. So since I’m trying to rework MS code I’m not flying to blind… Or am I!!!! Well, if you think of anything please let me know and thanks for your help! Thanks, GregC
-
Hi Stephane, Sorry, yes the dim I wrote as I was writing the message is the interface, I left off the Class suffix. I have tried it a bunch of different ways Dim objevent As New CEventObjClass() Dim objevent As New mshtml.CeventObjClass In fact none of the classes will work in the dll. I get the same COMException for any I try. What I’m actually trying is to get MS Knowledge Base Article 279535 to work. The short program uses a property in the class CEeventObjClass to disable script error checking for forms hosting a WebBrowser control. For whatever reasons Microsoft did not implement this disabling script feature for WebBrowser controls by selecting it from IE (even through it is really the same object). It is available for IE. So they supply you with a code example in VB6 not VB.net to address this problem. Actually I can understand why they did it this way because you might want to disable script error checking for IE but not completely across any applications that host Web controls on the same system. So since I’m trying to rework MS code I’m not flying to blind… Or am I!!!! Well, if you think of anything please let me know and thanks for your help! Thanks, GregC
Don't get it wrong, but I think you don't understand what you are doing. The support KB article you refer to NEVER creates an instance of the CEventObjClass. Quite the contrary, the only thing it does is change a property value on the event interface being passed by the IE event dispatch mechanism. In the support KB article, objEvent is that interface. It's created by IE and passed along to subscribers. Now that I know what's going on, I wonder what's your problem here. You just need to reproduce the code that is given in the support KB article. There is no "New event something " involved in here. Good luck! ;)
-
Don't get it wrong, but I think you don't understand what you are doing. The support KB article you refer to NEVER creates an instance of the CEventObjClass. Quite the contrary, the only thing it does is change a property value on the event interface being passed by the IE event dispatch mechanism. In the support KB article, objEvent is that interface. It's created by IE and passed along to subscribers. Now that I know what's going on, I wonder what's your problem here. You just need to reproduce the code that is given in the support KB article. There is no "New event something " involved in here. Good luck! ;)
I’m a Network engineer I’m not programmer heavy and I think I understand what you are saying. I did try the code exactly as stated in the article but I ran into other problems (below) with the dim statements. What I was attempting to do was to go a different way. I was hoping I could set the field True in the CEventObjclass (which I thought this code is trying to do) and if I could do that I was hoping I could set return value true always regardless of an onError event so that I could continually disable script error checking. Ok that being said are you saying that the field being made available through the interfaces (really address pointers), passed in a sense to its subscribers (a webbrowser control) is really a property of IE? Am I correct in understanding what you are saying? I’m getting Com errors with the standard dims described in the article. The first Interface dim works fine: dim withevents for HTMLDocument The second interface dim does not work: Dim WithEvents objwind As New mshtml.HTMLWindow2() Additional information: COM object with CLSID {D48A6EC6-6A4A-11CF-94A7-444553540000} is either not valid or not registered. And of course the third does not work either: Dim objevent As New CEventObj() did not work as stated in the article Additional information: COM object with CLSID {3050F48A-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered. In trying to resolve the COMException for the dim of Interface CEventObj I have tried un-registering and re-registering the interop dll Microsoft.mshtml.dll in \Program Files\Microsoft.net\Primary Interop Assembles\ Any ideas? I get the same kind of error when trying the code it exactly in the KBase Article. Please let me know if my understanding now about passing the field is correct. After all I never get upset about this stuff everything we do is a learning experience. Thanks, GregC
-
I’m a Network engineer I’m not programmer heavy and I think I understand what you are saying. I did try the code exactly as stated in the article but I ran into other problems (below) with the dim statements. What I was attempting to do was to go a different way. I was hoping I could set the field True in the CEventObjclass (which I thought this code is trying to do) and if I could do that I was hoping I could set return value true always regardless of an onError event so that I could continually disable script error checking. Ok that being said are you saying that the field being made available through the interfaces (really address pointers), passed in a sense to its subscribers (a webbrowser control) is really a property of IE? Am I correct in understanding what you are saying? I’m getting Com errors with the standard dims described in the article. The first Interface dim works fine: dim withevents for HTMLDocument The second interface dim does not work: Dim WithEvents objwind As New mshtml.HTMLWindow2() Additional information: COM object with CLSID {D48A6EC6-6A4A-11CF-94A7-444553540000} is either not valid or not registered. And of course the third does not work either: Dim objevent As New CEventObj() did not work as stated in the article Additional information: COM object with CLSID {3050F48A-98B5-11CF-BB82-00AA00BDCE0B} is either not valid or not registered. In trying to resolve the COMException for the dim of Interface CEventObj I have tried un-registering and re-registering the interop dll Microsoft.mshtml.dll in \Program Files\Microsoft.net\Primary Interop Assembles\ Any ideas? I get the same kind of error when trying the code it exactly in the KBase Article. Please let me know if my understanding now about passing the field is correct. After all I never get upset about this stuff everything we do is a learning experience. Thanks, GregC
gregcost wrote: CEventObjclass (which I thought this code is trying to do) Change your glasses. gregcost wrote: I could set return value true always regardless of an onError event so that I could continually disable script error checking. Yes, there is another way to disable script error when you are hosting the web control. The way it is explained in the support KB article is a transient way of disable script errors. In fact, they are not disabled. You subscribe the onerror event, and wheenever an error occurs you block it rather than let IE popup a message box. This is transient. This code must be executed for each new web page being loaded. There is a way to do it for the entire life cycle of your application, and without changing the users options in the registry (Internet options / Advanced / ...). I guess you can find a support KB article but from what I remember, you have to use the ExecCmd method and pass it a special OLECMDID_DISABLEERRORXXXXXXX cmd id (I don't remember the name). You won't find the cmd id in the MSDN doc though, for some reason.