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

  • SEARCH
  • Home
  • 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 318997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:37:15+00:00 2026-05-12T08:37:15+00:00

I have a VB.net class registered for COM interop which I’m instantiating within an

  • 0

I have a VB.net class registered for COM interop which I’m instantiating within an HTML page using the following code:

<script type="text/javascript">
var MyClass = new ActiveXObject("Namespace.TestClass");
</script>

I can call methods on it just fine, but suppose I want to set a javascript function as a property, like so:

MyClass.TestFunction = function () { alert("It worked!"); }

How would I set my vb.net code up to be able to fire that function? This is how MSXML works in javascript for XMLHttpRequest objects, you can set

XHR.onreadystatechange = function () {}

I’m looking for a similar implementation in my class.

  • 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-12T08:37:16+00:00Added an answer on May 12, 2026 at 8:37 am

    After trying for a while, we managed to figure out a solution that worked pretty well. Since we’re setting a javascript function to the property, all the properties and methods on that function are made available to the VB.net, including the javascript standard methods, call and apply:

    (function () { alert("Hello"); }).call();
    

    The solution was to just invoke the call method in the VB.net code and it seems to work pretty well.

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

Sidebar

Ask A Question

Stats

  • Questions 156k
  • Answers 156k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer http://www.ruby-doc.org/core/classes/Set.html [1, 2].to_set == [2, 1].to_set Might help... May 12, 2026 at 10:58 am
  • Editorial Team
    Editorial Team added an answer the problem is that the loading of the image ties… May 12, 2026 at 10:58 am
  • Editorial Team
    Editorial Team added an answer Found a fix. In my code I had a class… May 12, 2026 at 10:58 am

Related Questions

I've used a tutorial ( http://support.microsoft.com/kb/317535 ) to create a VB.NET Class that exports
Has anyone got any suggestions for unit testing a Managed Application Add-In for Office?
I have a Visual Studio 2008 solution with two projects (a Word-Template project and
There’s a really cool diff class hosted by Google here: http://code.google.com/p/google-diff-match-patch/ I’ve used it
I am looking to create a user/server control that will be created with something

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.