locked
Com Interop for VB (Silverlight 4) RRS feed

  • Question

  • Hi all

    This might be a really stupid question but - is COM interop within Silverlight 4 available if you're coding in VB? Everything I've seen relates just to C# - no examples or anything for VB. If anyone has any examples for VB would REALLY appreciate it.

    Cheers

    Wednesday, April 21, 2010 9:20 AM

Answers

  •   Hello,

     Com interop is available for VB as well. Here is a very simple code-snippet that starts InternetExplorer and navigates to a page using Com interop :

      

    Dim ie As Object = AutomationFactory.CreateObject("InternetExplorer.application")
    ie.Visible = True
    ie.Navigate(urlBox.Text)

     

    For this to work, you will have to: Imports System.Runtime.InteropServices.Automation

      

    Wednesday, April 21, 2010 12:23 PM

All replies

  •   Hello,

     Com interop is available for VB as well. Here is a very simple code-snippet that starts InternetExplorer and navigates to a page using Com interop :

      

    Dim ie As Object = AutomationFactory.CreateObject("InternetExplorer.application")
    ie.Visible = True
    ie.Navigate(urlBox.Text)

     

    For this to work, you will have to: Imports System.Runtime.InteropServices.Automation

      

    Wednesday, April 21, 2010 12:23 PM
  • Brilliant - thanks for your help. So basically, all the examples I'm seeing for C# where they're using dynamic is the same as VB object.

    Cheers

    Thursday, April 22, 2010 11:07 AM