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 1014383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:14:47+00:00 2026-05-16T10:14:47+00:00

I’m learning how to write a scriptable ActiveX control. My goal is to have

  • 0

I’m learning how to write a scriptable ActiveX control. My goal is to have a tiny control that can check to see if something is installed on the system. What I’ve done so far is:

  • Create a MFC ActiveX control project in VS2008
  • Add some ‘safe for scripting’ bits that I found here.
  • Extend the IDL to provide my “IsInstalled” method, which for now returns TRUE unconditionally (but will later read some keys from the registry.)
  • Build the control and run regsvr32 on it. I verified that it does show up in HKEY_CLASSES_ROOT, and when I instantiate the object, the IE Developer Tools “Locals” pane shows that the object is of type _D[my plugin name]. Not only that, but my IsInstalled() method shows up underneath that object.

However, when I call IsInstalled(), I just can’t get it to work:

JScript Debugger – Breaking on JScript runtime error -(n http://img138.imageshack.us/img138/1586/whycomwhy.png

I’m at a loss. I’ve also tried making IsInstalled a property instead of a method, using VARIANT_BOOL instead of boolean instead of BOOL in the IDL, you name it.

Here’s the relevant excerpts of code.

The header:

afx_msg VARIANT_BOOL IsInstalled();

The implementation:

afx_msg VARIANT_BOOL
CMyAXCtrl::IsInstalled()
{
   return TRUE;
}

The dispatch map:

BEGIN_DISPATCH_MAP(CMyAXCtrl, COleControl)
   DISP_FUNCTION_ID(CMyAXCtrl, "IsInstalled", dispidIsInstalled, IsInstalled, VT_BOOL, VTS_NONE)
END_DISPATCH_MAP()

The dispatch part of the IDL:

   [ uuid(6B662202-CF13-4144-AA33-C3FEE9C2C962),
      helpstring("Dispatch interface for My Control")]
   dispinterface _Daxplugin
   {
   properties:
   methods:
      [id(1)] VARIANT_BOOL IsInstalled();
   };

If there’s any other relevant bits of code I should provide, let me know. But I’m stumped here. Thank you in advance!

  • 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-16T10:14:47+00:00Added an answer on May 16, 2026 at 10:14 am

    You almost certainly have the wrong prototype for a scriptable function. OLE Automation for scripting languages tends to rely on returning a HRESULT then using an out parameter for the actual return code.

    So change it to
    [id(1)] HRESULT IsInstalled(VARIANT_BOOL* p);

    Also TRUE != VARIANT_TRUE, you must return VARIANT_TRUE which is equal to -1 instead of 1.

    Hope some of that actually helps, but without the actual error I might be mistaken 🙂

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.