Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to get the box from Click event (Read 1923 times)
Jose
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Mar 7th, 2008
how to get the box from Click event
May 1st, 2008 at 5:30am
Print Post  
Hi,
  i am handling click event for the box item. the member function generated is
OnBoxClicked(LPDISPATCH box, long button, long x, long y)

from this, how can i get the required box, ie the box on which I clicked.

Can I use CBoxItem myBox = box;

This worked, but was crashing sometimes. Please help.

Thanks in advance.. Shinoj Jose..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to get the box from Click event
Reply #1 - May 1st, 2008 at 7:17am
Print Post  
Hi,

The MFC wrapper decrements the reference count for the box when the wrapper's destructor is called, but that should not be done in event handlers. Call the wrapper's DetachDispatch method before returning from the handler method, or use the constructor that takes a boolean bAutoRelease value, setting it to FALSE.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Jose
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 12
Joined: Mar 7th, 2008
Re: how to get the box from Click event
Reply #2 - May 1st, 2008 at 7:40am
Print Post  
hi,
  it helped. now working fine..

Thanks a lot.

regards,
shinoj jose
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint