Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:48:00+00:00 2026-05-25T21:48:00+00:00

I have a hyrid type application (web and forms). It’s a .net compact framework

  • 0

I have a hyrid type application (web and forms). It’s a .net compact framework app. On one of the forms I have a WebBrowser control.

I want to communicate between the WebBrowser control and the form that host/contains the WebBrowser control.

To do this I plan to create an Activex (COM) object in C++ compiled for the windows mobile device.

I plan to use JavaScript to create an instance of the ActiveX control on the web page that is displayed in the WebBrowser control.

How can I get a reference to this ActiveX control that I can then send to the form?


My objective is to send a reference of the ActiveX control instance to the windows mobile form that contains the WebBrowser control so that both the web page and form can use/access the same instance of the ActiveX control.

I created a way to send strings from the ActiveX control to the form. Is there a way to convert a reference of the ActiveX control to a string then pass the string to the form and re-create a reference to the object instance on the form side?

I hope this makes sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:48:00+00:00Added an answer on May 25, 2026 at 9:48 pm

    You can get an IDispatch reference to the window using something like this:

    CComPtr<IWebBrowser2> m_webBrowser(/* create, assign, whatever to get the pointer */
    CComQIPtr<IHTMLWindow2> m_htmlWin;
    CComPtr<IDispatch> m_htmlDocDisp;
    CComQIPtr<IDispatch> m_htmlWindDisp;
    
    m_webBrowser->get_Document(&m_htmlDocDisp);
    CComQIPtr<IHTMLDocument2> doc(m_htmlDocDisp);
    assert(doc);
    doc->get_parentWindow(&m_htmlWin);
    assert(m_htmlWin);
    
    m_htmlWindDisp = m_htmlWin;
    assert(m_htmlWin);
    

    Once you have that, you can use IDispatch methods to either query the value of a property on the window object or you can set the value of such a property. For example, if you create an IDispatch object that exposes methods and properties then you use the m_htmlWindDisp object to Invoke with PROPERTYPUTREF that object as “foo” then you could access that object from javascript using “window.foo”. Alternatley, using Invoke with PROPERTYGET you can get the IDispatch handle for an object that you set on window, such as “window.foo = someFooBaredObject”

    Hope that makes sense.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hybrid ASP.Net web forms/MVC app. On one of the MVC pages/views,
I have a hybrid asp.net web forms / mvc application that I recently converted
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
I have a web application that needs to be built using PHP/MySQL. The application
I have a C++ Win32 application that runs as a console app if run
I need to track/modify QtWebkit HTTP requests. I have a hybrid web/desktop application prototype
I have a hybrid ASP.NET MVC application, and I'd like to test that the
I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a
We have a hybrid WCF and ASMX web service currently being used on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.