Welcome Guest Search | Active Topics | Sign In | Register

Object of type 'EO.WebBrowser.WebView' cannot be converted to type 'EO.WebBrowser.WebVie Options
Chris
Posted: Thursday, September 24, 2020 10:15:49 AM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
Hi, I just downloaded your EO.WebBrowser control to give it a spin. I have both the EO.WebBrowser and EO.WebBrowser.Winform components referenced in my project.

When I add the WebControl to a WinForm it automatically adds a WebView control. This WebView control is assigned to the WebBrowser control.

If I close the form and reopen it, I receive an error:
Severity Code Description Project File Line Suppression State
Message Object of type 'EO.WebBrowser.WebView' cannot be converted to type 'EO.WebBrowser.WebView'. C:\DevNet\DT4\Main\CC API 3.0\frmCCV3Login.Designer.vb 48

The line it's pointing to in the form designer is:
Code: Visual Basic.NET
Me.WebControl1.WebView = Me.WebView1


Thoughts?

eo_support
Posted: Thursday, September 24, 2020 11:06:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
That's quite puzzling. :) Please try the following:

1. Right click on the toolbox, then click "Choose Items", look for "WebControl" in the list. Make sure you only have one WebControl, and make sure the path of the DLL is from the same location where you reference in your project;
2. Try to reference EO.WebBrowser.WinForm.dll, EO.WebBrowser.dll, EO.WebEngine.dll and EO.Base.dll;
3. Restart Visual Studio;

Please let us know if this works for you.

Thanks!
Chris
Posted: Thursday, September 24, 2020 1:00:33 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
First of all, thank you for your quick reply.

I found a reference to a GrapeCity control called webviewer. I removed it.
I also remove a reference to Windows.system.webrowser.
I've ensured that EO.WebBrowser.WinForm.dll, EO.WebBrowser.dll, EO.WebEngine.dll and EO.Base.dll are referenced in the project.
I've ensured that the two controls are both coming from the EO folder
I created a new Windows form. No other controls on it.
I added the WebControl to the form and the WebView control was automatically added and assigned. I saved the form, closed it and reopened it.

I'm getting different errors now.

"An item with the same key has already been added"

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at EO.Internal.dntz.cgsw.anyp..ctor(Action kcs, cgst kct)
at EO.Internal.dntz.cgsw.ickh(Action kcl, cgst kcm)
at EO.WebEngine.Engine.royf()
at EO.WebBrowser.WebView.tlgt.psbl()
at EO.Internal.dntz.ickh(cgsu kcg)
at EO.WebBrowser.WebView..cctor()

The variable 'WebView1' is either undeclared or was never assigned

when I click "Ignore and Continue" the WebView1 control is missing.

Visual Studio 2017 - VB.Net 32 bit application
.Net 4.7.2
Windows 10/64 bit Enterprise

Are there any known conflicts with either ComponentOne controls or Grapecity Active Reports components?

Thanks.
Chris
Posted: Thursday, September 24, 2020 1:32:36 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
As a follow-up to my last reply, I'd like to add that I created a new Winforms project with one form and no other references and I'm getting the same behavior as stated above.

EO version 20.2.34.0

Thanks.


eo_support
Posted: Thursday, September 24, 2020 1:48:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
If you just close the Form designer and run the application, do you get any error?
Chris
Posted: Thursday, September 24, 2020 2:19:45 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
No error when I run the program and the form opens.

Just when I try to view the form in design mode. It's 2020 so anything is possible. ;)
eo_support
Posted: Thursday, September 24, 2020 3:29:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Yes. It's 2020. :( This is strange. We are not sure what else to tell you. We tested it here and if we do not reference all the DLLs, we do see an error message. However the problem would go away as soon as we reference all the DLLs.

We will continue to investigate this and will post here again if we find anything. In the mean time, you can simply ignore this error --- there isn't much of a design time support at all for the WebControl since almost everything is done at runtime.
Chris
Posted: Thursday, September 24, 2020 3:38:52 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
Yeah, I don't think ignoring the error is an option. Unless the WebControl.dll Control can function without the WebView.dll control on the form. Opening the form (Ignore and Continue) completely removes it. If I try and add the WebView control back to the form, I receive the same error.

Thanks for your efforts.
eo_support
Posted: Thursday, September 24, 2020 3:55:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

You don't exactly need the WebControl to be in the design view. The design view supposes to make things easier for you but obviously in your case it made it worse. If you just have a blank Form1, you can add WebControl into the form with code easily:

Code: Visual Basic.NET
Public Class Form1
  Friend WithEvents WebControl1 As EO.WinForm.WebControl
  Friend WithEvents WebView1 As EO.WebBrowser.WebView

  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'The following 4 lines are the key
    Me.WebControl1 = New EO.WinForm.WebControl()
    Me.WebView1 = New EO.WebBrowser.WebView()
    Me.WebControl1.WebView = Me.WebView1
    Me.Controls.Add(Me.WebControl1)

    'The following lines are optional
    Me.WebControl1.Location = New Point(50, 50)
    Me.WebControl1.Size = New Size(300, 300)
    Me.WebView1.Url = "http://www.google.com"
  End Sub
End Class


The first 4 lines of the code in Form1_Load is what initializes the WebControl and the corresponding WebView object. The rest are just setting whatever properties you need to set.

Thanks!
Chris
Posted: Thursday, September 24, 2020 4:21:29 PM
Rank: Newbie
Groups: Member

Joined: 9/24/2020
Posts: 6
Oh hey, check that out. Works like a charm.

Thank you for the idea. I can work with it from here.

Thanks again.

Chris


eo_support
Posted: Thursday, September 24, 2020 5:04:17 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Great! Please feel free to let us know if there is anything else.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.