Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DrawMark event (Read 3904 times)
Remko
YaBB Newbies
*
Offline



Posts: 12
Joined: Dec 7th, 2005
DrawMark event
Dec 12th, 2005 at 2:12pm
Print Post  
I'm trying to add an DrawMark event handler to my code

I was guessing the ON_EVENT macro should look something like

Code
Select All
ON_EVENT(CMapDiagramView, IDC_FLOWCHARTX, 89, OnDrawMark, VTS_I4 VTS_I4 VTS_I4 VTS_DISPATCH VTS_DISPATCH VTS_I4 )
 



with as corresponding method

Code
Select All
afx_msg void OnDrawMark( LONG *hdc,
				     LONG docX, LONG docY,
				     LPDISPATCH node, LPDISPATCH aPattern,
				     LONG anchorIndex );
 



sadly this doesn't work, and when I inspect the event in the debugger I see 6 parameters

VTS_I4 (0) VTS_DISPATCH (??) VTS_DISPATCH (??) VTS_I4 (106) VTS_I4 (271) ??

which would suggest the sequence is
hdc, node, aPattern, x, y, ?

Is there maybe a mistake in the documentation, or am I making a mistake ?

with kind regards,
Remko
  
Back to top
 
IP Logged
 
Remko
YaBB Newbies
*
Offline



Posts: 12
Joined: Dec 7th, 2005
Re: DrawMark event
Reply #1 - Dec 12th, 2005 at 2:22pm
Print Post  
Ok, I found where I went wrong Embarrassed

ON_EVENT(CMapDiagramView, IDC_FLOWCHARTX, 89, OnDrawMark, VTS_PI4 VTS_I4 VTS_I4 VTS_DISPATCH VTS_DISPATCH VTS_I4 )

fixes it Smiley
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DrawMark event
Reply #2 - Dec 12th, 2005 at 2:27pm
Print Post  
The event is declared like this in the IDL:

HRESULT DrawMark([in]LONG* hdc, [in] LONG docX, [in] LONG docY,[in] LPDISPATCH node, [in] IAnchorPattern* aPattern, [in] LONG anchorIndex);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DrawMark event
Reply #3 - Dec 12th, 2005 at 2:38pm
Print Post  
Then I guess the PI4 corresponds to LONG* ...

Stoyan
  
Back to top
 
IP Logged
 
Remko
YaBB Newbies
*
Offline



Posts: 12
Joined: Dec 7th, 2005
Re: DrawMark event
Reply #4 - Dec 13th, 2005 at 10:52am
Print Post  
To be complete, the second VTS_DISPATCH should be a VTS_UNKNOWN

ON_EVENT(CMapDiagramView, IDC_FLOWCHARTX, 89, OnDrawMark, VTS_PI4 VTS_I4 VTS_I4 VTS_DISPATCH  VTS_UNKNOWN VTS_I4 ) 

The LPUNKNOWN can than be narrowed to an IAnchorPattern * using QueryInterface

There may be a simpler way to implement this, but for now it works like a charm  Smiley
« Last Edit: Dec 14th, 2005 at 7:31am by Remko »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint