HTML: Detecting if your ActiveX object has launched

Discussion in 'Game Development (Technical)' started by Raptisoft, Aug 26, 2004.

  1. Raptisoft

    Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    804
    Likes Received:
    0
    Hi all,

    Okay, I'm trying to adapt to Microsoft's insane new SP2 ActiveX stuff, sigh. What I need to do is run some javascript AFTER my ActiveX object gets downloaded.

    I've tried a couple "typeof" statements, just running over and over again, but they always tell me they're undefined.

    Does anyone have a good javascript code snippet for determining if an ActiveX object has downloaded?

    Thanks!
     
  2. gmcbay

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    280
    Likes Received:
    0
    Haven't actually tried this since its been a while since I've done ActiveX programming, but what about calling some dummy method on the ActiveX object and putting the call in a JavaScript try {} catch block? When it doesn't throw an exception, the ActiveX is loaded... maybe?
     
  3. Raptisoft

    Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    804
    Likes Received:
    0
    Hm... I just spent the last x amount of time trying this. This dummy functions is *always* considered undefined, so I assume I'm exporting it improperly or something.
     
  4. gmcbay

    Indie Author

    Joined:
    Jul 28, 2004
    Messages:
    280
    Likes Received:
    0
    Are you sure you're putting the method in the ActiveX object's IDL file? If not it won't get exported to the outside world.

    Have you tried viewing the ActiveX's typelib using the "OLE/COM Object Viewer" that lives under Visual Studio's "Tools" menu? It should show you what methods are registered for that control, so you can check to see if the one you're trying to call is there...

    Also, I'd try putting the control in the ActiveX Control Test Container (same place, under the Tools menu) and try invoking the method from there... Then you at least know if its a JavaScript thing or a problem with the control...

    (The above assumes you're using Visual C++)
     
  5. Raptisoft

    Indie Author

    Joined:
    Jul 29, 2004
    Messages:
    804
    Likes Received:
    0
    I got it. I was adding the function manually. When I add it with the class wizard, it works... though a file compare on the two versions reveals no differences. That's definitely one of the things I hate about visual studio.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer