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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:14:31+00:00 2026-06-14T06:14:31+00:00

I am trying to make externs for the Google Closure Compiler for types that

  • 0

I am trying to make externs for the Google Closure Compiler for types that have no constructor.

I have tried the following, but it gives me a Bad type annotation. Unknown type WindowsMediaActiveX.Cdrom error because nothing tells the compiler that WindowsMediaActiveX.Cdrom is a type instead of just a collection of methods/properties.

/**
 * @fileoverview Declares externs for the Windows media player ActiveX control.
 * @author Joshua Dwire
 * @suppress {duplicate}
 */

var WindowsMediaActiveX={};


/**
 * Methods and properties for accessing a CD or DVD in its drive.
 */
WindowsMediaActiveX.Cdrom={};


/**
 * Retrieves the CD or DVD drive letter.
 * @type {string}
 * @readonly
 */
WindowsMediaActiveX.Cdrom.prototype.driveSpecifier;



/**
 * Methods and properties for accessing a collection of CD or DVD drives.
 */
WindowsMediaActiveX.CdromCollection={};


/**
 * Retrieves the Cdrom object associated with a particular drive letter.
 * @param {string} driveSpecifier String containing the drive letter followed by a colon (":") character.
 * @returns {WindowsMediaActiveX.Cdrom}
 */
WindowsMediaActiveX.CdromCollection.prototype.getByDriveSpecifier=function(driveSpecifier){};

I know I could change:

/**
 * Methods and properties for accessing a CD or DVD in its drive.
 */
WindowsMediaActiveX.Cdrom={};

to:

/**
 * Methods and properties for accessing a CD or DVD in its drive.
 * @constructor
 */
WindowsMediaActiveX.Cdrom=function(){};

but then the compiler wouldn’t show a warning if I or someone else tried to use new WindowsMediaActiveX.Cdrom(). Any ideas on how to define this?

For those of you who want more information, I am working on a media player that will use the Windows Media ActiveX Control to play media. I am also using the Google Closure Compiler and Library. I need to define the externs for the player to work correctly, but none of the types used by the ActiveX Control have constructors. They are all created through other methods or through creating an object in the html. How should I define this in the extern file? Thanks for your help.

  • 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-06-14T06:14:33+00:00Added an answer on June 14, 2026 at 6:14 am

    The typical annotation for this pattern is:

    /** @const */
    var WindowsMediaActiveX = {};
    
    /**
     * Methods and properties for accessing a CD or DVD in its drive.
     * @constructor
     * @private
     */
    WindowsMediaActiveX.Cdrom=function(){};
    

    The @private annotation is the indication that the constructor is not meant to be directly called. However, the compiler will only report a warning on direct instantiations of the type when the accessControls warning group is enabled (on with VERBOSE warnings).

    Edit: Answer updated to add the required @const annotation to the namespace. The access control annotations will be ignored otherwise.

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

Sidebar

Related Questions

I'm trying to get KineticJS to work with Google Closure Compiler. KineticJS, however, generated
I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a small countdown timer in my app but it's not working.
Im trying to make a small app in c++ that saves midifiles with this
I am trying to make a function in C that will print a string
I have been trying to make an s-function block in matlab with my c++
I am trying to annotate my Javascript properly in order to avoid Google Closure
I've been reading posts all over and trying different approaches, but I can't make
I'm trying make a login window where a user is prompted to enter their

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.