Welcome to MSDN Blogs Sign in | Join | Help

Why doesn't drag/drop work with BindEvents?

In this post: Is this a bug in BindEvents? I asked why drag/drop wasn’t working.

 

The code to dispatch methods or events to the appropriate user routines tests to see if the user has bound code that might occur before or after calling the target code. If additional bound code needs to be executed, then all the parameters need to be copied to temporary storage, the routine is called, then all the parameters are pushed again on the stack for the 2nd routine. Thus if a parameter is passed by reference, changes made by the 1st routine invoked would be discarded, resulting in perhaps broken behavior.  Thus, SDavila was correct that the reason was because of a parameter passed by reference, but it’s not the DataObject parameter. nEffect is passed by reference.

 

Start Task Manager, Solution Samples and search for “Drag” to look for more sample code for Drag and Drop.

Also, MSDN describes IDropTarget::DragOver which passes nEffect by reference.

 

Published Friday, March 03, 2006 10:52 AM by Calvin_Hsia

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Why does BINDEVENT not work with StatusBar_Change?

Wednesday, March 08, 2006 8:30 PM by Calvin Hsia's WebLog
A customer had a question and sent some code:
 
PUBLIC oHandler
oHandler = NEWOBJECT("StatusBarText")...

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker