Solved

ActiveX Events caught in HTML document

Posted on 2000-03-01
1
222 Views
Last Modified: 2010-04-10
I have created an ActiveX control for embedding in a HTML document using VC++.

The control is working well. My problem is that I wish to generate an event in the control which is caught by the browser/html page and activates a VBScript or Javascript function defined within that page.

Using the VC++ class wizard, i have created a custom event which is fired  by the control under certain circumstances.

How can i map this event to a VBScript of Javascript function?

I have tried using a standard ActiveX event (eg FireClick) and catching it with an <OBJECT> tag "onClick" property, but this does not seem to work.

Alternatively, is there a C++ function/method available to my ActiveX control which enables me to re-direct the browser to another URL (ala AppletContext functions in java).

please help!
many thanks,
Brendan.
0
Comment
Question by:mrpinko2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 2593968
You don't do it with the <OBJECT> statement, you do it like this:

<html>

<head>
<title>Test</title>
</head>
<object ID="Pinger" CLASSID="CLSID:DC458CF3-3ED8-11D2-84CE-0020AFEDCD49">
</object>

<body>

<p>Hello <BUTTON ID="test">Click me</BUTTON>

<script LANGUAGE="vbscript" FOR="test" EVENT="onclick">
<!--
      call window.alert("Trying to ping")
      Pinger.Ping
-->
</script>

<script
LANGUAGE="VBScript" FOR="pinger" EVENT="pong">
call window.alert(pong)
</script>

</p>

</body>
</html>

The PING object has an event called PONG. This web page catches the event using VBSCRIPT, but you can also use JSCRIPT.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question