Site icon EfmSoft

What does HRESULT 0x00040101 (DRAGDROP_S_CANCEL) mean?

 
Previous Next
DRAGDROP_S_DROP DRAGDROP_S_USEDEFAULTCURSORS

DRAGDROP_S_CANCEL

OLE drag-and-drop canceled without a drop

DRAGDROP_S_CANCEL is HRESULT 262401 (0x00040101) from winerror.h. The documented description is “Drag-drop operation canceled.” The high-order severity bit is clear, so this is a success result, but it carries more information than plain S_OK.

The modal OLE drag loop ended normally because the drag operation was canceled rather than delivered to a target.

State to verify

The central question is whether no target-side transfer was committed and the source object remains in its pre-drag state.

A reliable interpretation of this result names the exact method contract, the object instance, and the outputs that remain valid. This prevents a success-with-information result from being promoted to full success or demoted to a generic error.

Where the result is encountered

  • This result can appear in escape-key cancellation; record the producing interface and method.
  • It can appear in mouse-button state that tells IDropSource to cancel; record the producing interface and method.
  • It can appear in source or target logic that intentionally stops an in-progress drag; record the producing interface and method.

Evidence to preserve

  • Preserve the QueryContinueDrag inputs and return history.
  • Preserve keyboard and mouse-button state.
  • Preserve last target entered and proposed effect.
  • Preserve whether any target preview or temporary object was created.
  • Preserve source data ownership after the loop exits.

Diagnostic sequence

  • Capture the raw HRESULT 0x00040101 immediately after the returning method and record whether the caller used SUCCEEDED, FAILED, equality testing, or exception translation.
  • Verify the method-specific state: no target-side transfer was committed and the source object remains in its pre-drag state.

Correct handling, retry, and recovery

Remove temporary drag UI and leave source data intact. Cancellation is an expected user outcome and normally should not trigger retries, error dialogs, or failure telemetry.

Practical validation scenario

A user presses Escape while dragging an attachment. The application receives it, removes the drag image, keeps the attachment in place, and records an informational cancellation event only.

Difference from nearby HRESULT values

DRAGDROP_S_DROP means a target accepted the transfer. E_ABORT can represent a failure-style abort in other COM contracts and should not be substituted without checking the API.

Developer and administrator guidance

References


Looking for a different code? Search another status or error code.

Exit mobile version