Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Drag'n'Drop and HGLOBAL

Status
Not open for further replies.

burgdavid

Programmer
Jun 22, 2000
70
DE
Hello,<br><br>I have make a window capable of multiple drap'n'drop (with other windows with same capability) thanks to threads. But I would like to unallow a window to drop to itself.<br><br>I use COleDropTarget and COleDataSource (Visual C++ 6 SP3, Windows NT 4 SP6).<br><br>I though I can do this by searching the HGLOBAL pointer recevied during drop in a class member array of HGLOBAL pointers of each drag started and not completed. But when I make a little try, storing the pointer HGLOBAL of the last drag in a member variable and then comparing to the HGLOBAL recieve, the values where different !! Why this ?<br><br>In OnBegindrag method :<br><br>HGLOBAL hgFiles;<br>COleDataSource* pSource = new COleDataSource();<br>(... Initialisation of hgFiles ...)<br>pSource-&gt;CacheGlobalData(CF_HDROP, hgFiles);<br><br>Then I retreive the HGLOBAL this way :<br>(in OnDragEnter(COleDataObject* pDataObject, ...)<br><br>STGMEDIUM Medium;<br>ASSERT(pDataObject-&gt;GetData(CF_HDROP, &Medium));<br>ASSERT(Medium.tymed == TYMED_HGLOBAL); <br><br>Now, the HGLOBAL pointer is Medium.hGlobal.<br><br>But the two HGLOBAL doesn't match.<br><br>Any Idea ?<br><br>David Burg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top