15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


How to change cursor when doing OLE drag-drop?

Peter Olesen -- peter.olesen@mailbox.swipnet.se
Thursday, February 22, 1996

Hi,

Development:
MSVC 2.2
NT 3.51 (no patch, no new shell)
MSDN Level2

Target:
Win32s, Win95 and WinNT.


I don't know if this is a MFC or a OLE question?

We have a MDI app with 3 different views. All views have a COleDropTarget
member.
In all views we kan start a drag operation by creating a COleDataSource object
and we CacheGlobalData and then call DoDragDrop.

Everything works OK except that we would like to use different cursors then the
standard cursors supplied by OLE.

We would like to change the cursor depending on what object is currently under
the cursor in the target view.

We use a COleDropSource derived class to give visual feedback from the drag
source,
i.e. we hide or show the drag source dependig on if it is a move or copy.

Is it possible to return more than DROPEFFECT_MOVE or DROPEFFECT_COPY from the
OnDragEnter and OnDragOver functions to let the GiveFeedback set the correct
cursor?

What values can be used together with the dropeffects?
Should this be done in some other way?

//------------------------------------------------------------//
// Peter Olesen                                               //
// (peter.olesen@mailbox.swipnet.se)                          //
//                                                            //
// "Support the Blue Ribbon Campaign for free speech online." //
//------------------------------------------------------------//




Ken Freeman -- kfreeman@viewlogic.com
Monday, February 26, 1996

I asked this same question to comp.os.ms-windows.programmer.ole.  Don 
Box's suggestion was (Don writes the OLE column for MSJ):

> "How about using IDataObject::SetData to push some state back to the
> source?
>
> One other approach would be to implement a custom interface on the dragged
> object and just have an explicit method for doing it.
>

I haven't tried these yet (I decided to stick with the cursors I had), but
SetData should do the trick.

Ken
=======
Peter Olesen wrote:
> 
> Hi,
> 
> Development:
> MSVC 2.2
> NT 3.51 (no patch, no new shell)
> MSDN Level2
> 
> Target:
> Win32s, Win95 and WinNT.
> 
> I don't know if this is a MFC or a OLE question?
> 
> We have a MDI app with 3 different views. All views have a COleDropTarget
> member.
> In all views we kan start a drag operation by creating a COleDataSource object
> and we CacheGlobalData and then call DoDragDrop.
> 
> Everything works OK except that we would like to use different cursors then the
> standard cursors supplied by OLE.
> 
> We would like to change the cursor depending on what object is currently under
> the cursor in the target view.
> 
> We use a COleDropSource derived class to give visual feedback from the drag
> source,
> i.e. we hide or show the drag source dependig on if it is a move or copy.
> 
> Is it possible to return more than DROPEFFECT_MOVE or DROPEFFECT_COPY from the
> OnDragEnter and OnDragOver functions to let the GiveFeedback set the correct
> cursor?
> 
> What values can be used together with the dropeffects?
> Should this be done in some other way?
> 
>




| Вернуться в корень Архива |