OLE Container versus ActiveX control

Hi,

I have placed an OLE Container on a Window and selected ‘Microsoft Web Browser’ as Active X control. No problems.
For document presentation purposes I need to implement the 'NavigateComplete2_Event, which is not available in the list of events.

If I place an ActiveX control on my Window with ‘Insert ActiveX Control’ and I select the Microsoft Web Browser, the event is available.

So I thought I simply change controls. But, due to a bug, I cannot change the name of the ActiveX control. As soon as I tab out on the name field, the control is renamed as ‘Besturingselement van Microsoft’ (Dutch) and cannot be changed but also raises a compiler error, because of the names and spaces (I guess). You can’t change it, but you also can’t use the default name. :frowning:

So, to circumvent this ‘feature’, how can I implement the ‘NavigateComplete2_Event’ in the OLE Container ActiveX component?

It’s parameters should be: ‘pDisp_Param As COM.IDispatch, URL_Param As Variant’.

Help very much appreciated.

I was not able to reproduce the problem with the ActiveX Control. The name can be changed fine and I was able to add the NavigateComplete2_Event.

activex.xojo_binary_project

Hi Michel,

right, it happens (at least so far I can reconstruct it) when you add a ActiveX control, save the project and then delete it. Once you add a new object you get this behaviour.

In the project I attached I tried to change names in the main clas as well as instances, and all went fine.

So now let me understand how to try and reproduce your issue :

  • Save the project
  • Delete the class
  • Add a new ActiveX control for Microsoft Web Browser
  • Try to change its name ; that’s where it is happening to you, right ?

OK. I tried that, and was able to change all the names without seing what you described. Given the Deutch name that appears, I would be tempted to suppose an issue with your version of Windows and the particular ActiveX. Have you tried to look at the project I attached to see if the same phenomenon occurs on it ? Maybe been created on another version of the system it may exhibit a different behavior ?

Hi Michel,

I found a workaround. When I add the ActiveX control it is named (by default) Webbrowser1. When I try to rename that it fails, and I cannot reverse it anymore. It sticks to the default Windows name ‘Besturingselement van Microsoft’. But when I add a second instance of the WebBrowser it let me change the name…

Pff.

Good to know you found a workaround :slight_smile:

Thanks for your help. Nasty bug. Filed already.