|
-
December 22nd, 2005, 09:51 AM
#14
Re: Single Event Handle for Multiple Controls
I do have the source code to the ActiveX controls, I was the one who wrote them a year ago or so. What I meant to say is that I cannot/should not change the behaviour of the controls which are already being used in many places and different applications, just for them being used in one specific application. Especially since there seems to be a specific macros (ON_CONTROL_RANGE) to deal with my requirements...the trick is to get that macros to work 
The ActiveX controls are Knobs...when the knob changes in some way (through the user changing it by the mouse or keys) and everytime that happens, the ActiveX control fires a message "KnobChanged(short)" where short is is a short indicating the new value of the knob.
The following code:
Code:
//in somepage.h
void OnFirstKnobChange(short nPosition);
//in somepage.cpp
BEGIN_EVENTSINK_MAP(CSomePage, CWnd)
ON_EVENT(CSomePage, IDR_PARAMETERSTART, 1 , OnFirstKnobChange, VTS_I2)
END_EVENTSINK_MAP()
void CSomePage::OnFirstKnobChange(short nPosition)
{
int a = 0; //Set breakpoint here
}
Works fine, the breakpoint stops when I fiddle with the first knob in the window. So the aim is to use ON_CONTROL_RANGE to achieve the same thing for a number of such ActiveX controls.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|