locked
Microsoft.Web.WebView2 sample program from Microsoft RRS feed

  • Question

  • The program fails on this line of code:

    this.Controls.Add(this.webView2Control);

    line 217

    Object reference not set to an instance of an object

    I did not write this code. Microsoft did. Anyone know why their code fails?

    The dll is there.

    Getting this program to work may be a clue as to why TEdgeBrowser fails in Delphi 10.4





    • Edited by cupboy1 Wednesday, May 27, 2020 8:22 PM
    Wednesday, May 27, 2020 8:20 PM

All replies

  • Hello,

    You assume we know something about a ambiguous code sample from Microsoft.

    In any code seeing Object reference not set to an instance of an object think of the following. We get this error when the class item here or the control has not be create with a new keyword.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Proposed as answer by KHURRAM RAHIM Saturday, December 12, 2020 12:20 PM
    Wednesday, May 27, 2020 8:50 PM
  • Hi cupboy1,

    Thank you for posting here.

    Based on your description, it seems that you are using the new VCL TEdgeBrowser component introduced in RAD Studio 10.4.

    This is a third-party product and we usually do not support it.

    However, I found some information that may be helpful.

    TEdgeBrowser is an alternative to TWebBrowser, which uses Internet Explorer WebBrowser.

    Because Internet Explorer is part of the system components, it can be used without any preparation, but TEdgeBrowser uses Chromium-based Edge browser control, this control are not operating system components, so you need to install something to use it.

    Microsoft Edge Insider Channels(Canary)

    Microsoft.Web.WebView2

    Once you have installed Edge (Canary version) and the required Microsoft WebView2 software package, you can open the GetIt Package Manager window in RAD Studio 10.4 IDE and search for EdgeView2.

    After installing the software package, it will copy the DLLs required by the application in the RAD Studio redistributable folder, one for 32-bit applications and one for 64-bit applications (both are called WebView2Loader.dll). You will need to copy this DLL in the build target folder.

    The above content is from the Internet, I can't make sure these steps are correct and I can't test it. If you still have problems, please ask your questions on their official website, they provide a forum.

    Best Regards,

    Timon


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 28, 2020 2:10 AM
  • this.Controls.Add(this.webView2Control);

    line 217

    I did not write this code. Microsoft did. Anyone know why their code fails?

    Which code ?

    Link ?

    Thursday, May 28, 2020 3:34 PM
  • Hello

    I'm trying to use Microsoft.WebView2 from microsoft.web.webview2.0.9.579.nupkg 

    This version works with canary version of Edge only.

    Which version of Microsoft.WebView2 will work with Edge release ?
    Friday, December 11, 2020 7:37 AM