Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActiveX Events caught in HTML document

Posted on 2000-03-01
1
Medium Priority
?
225 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 600 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

722 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