Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Identifying URL of Web Page that .NET ActiveX is running within

Identifying URL of Web Page that .NET ActiveX is running within

Scheduled Pinned Locked Moved Windows API
comcsharphtmlhardwarehelp
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wiley23
    wrote on last edited by
    #1

    I thought this would be a relatively easy task but it is turning out to be surprisingly difficult. I would like to create an ActiveX control that can be embedded into a web-page and knows what the URL of the web-page it is embedded in is. Some googling around lead me the SHDocVw COM library (ugh) which seems like an overly complicated solution, but my options seemed few. However, using code such as: SHDocVw.IWebBrowser2 tmp = (SHDocVw.IWebBrowser2)System.Runtime.InteropServices.Marshal.GetActiveObject("InternetExplorer.Application"); (Or the ShellWindows-based solution) and an Object tag (HTML) such as Allows the original C# class/form to appear but fails as soon as the line above is executed. The failure is System.IO.FileNotFoundException: Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' Although the Interop.SHDocVW .dll is in the same directory (how to package two DLLs for ActiveX-via-.NET ... I thought CABs weren't used for .NET ActiveX and if they are, how to reference the classid?). Any help is greatly appreciated.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups