?
Solved

Adding an Event to ActiveX control created from DLL

Posted on 2004-10-04
2
Medium Priority
?
167 Views
Last Modified: 2010-04-05
I need to know how to add an Event to an ActiveX control I imported from a type library (DLL).  As I received it, the control works fine but only fires a few Drag Events, OnEnter and OnExit.  Before posting here I searched on the forums, but all the answers I could find assume I am creating an ActiveX control or Active Form from scratch, but I am using a DLL compiled in C++ that does not fire the events I want.  I need to be able to track the mouse position inside this control.  An example of how to add OnClick or Mousedown to such an ActiveX control would be very helpful.

Also any other workaround to track mouse position and clicks inside an ActiveX container would be sufficient.

Thanks!
0
Comment
Question by:whfolsom4
[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
2 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 375 total points
ID: 12225281
If it doesn't fire the events you want, then you're out of luck. It's the C++ code that will have to shoot those events in the first place. If it doesn't, well... Tough!

To track the mouse events, you might use the OnMouseMove events of the control below the ActiveX control. If not, you'll have to install a mousehook message handler. Not a pretty solution, though.
0
 

Author Comment

by:whfolsom4
ID: 12227094
Thanks, I did end up installing a mousehook message handler in the form of TApplicationEvents component.  Otherwise, it looks like the parent control receives no events when the mouse if over the ActiveX control.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

770 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