What does HRESULT 0x80040100 (DRAGDROP_E_NOTREGISTERED) mean?

 
Previous Next
DV_E_NOIVIEWOBJECT DRAGDROP_E_ALREADYREGISTERED

DRAGDROP_E_NOTREGISTERED

Trying to revoke a drop target that has not been registered

The native value 0x80040100 is DRAGDROP_E_NOTREGISTERED, unsigned 2147746048 and signed -2147221248. According to AllStat, it means “Trying to revoke a drop target that has not been registered”. Treat it as evidence that RevokeDragDrop was called for a window that is not currently registered as an OLE drop target; the operation in progress is unregistering a window during destruction, feature disablement, or target replacement.

The high bit in 0x80040100 is set, so this is a failure rather than a success or informational result. Its facility field is 4 (FACILITY_ITF) and its low 16-bit code is 256 (0x0100). Those bit fields classify the value, but they do not identify the failing object by themselves; the native method, object identity, and first producer of this result remain essential.

Operational meaning

Understanding this result requires this subsystem context: OLE drag-and-drop registration is tied to an HWND, its UI thread, and a COM apartment. IsWindow checks can describe a moment in time, but lifecycle serialization is what prevents stale handles, duplicate registration, and reentrant drag sessions.

  • Associate this result with one exact operation in RegisterDragDrop, RevokeDragDrop, DoDragDrop, window lifetime, and IDropTarget ownership.
  • Confirm that this result came from unregistering a window during destruction, feature disablement, or target replacement, rather than from cleanup or a wrapper that ran afterward.
  • Preserve any IErrorInfo, underlying Win32 result, provider message, or callback failure that preceded it; the HRESULT alone should not erase a more specific cause.

Cause model

  • It can result when cleanup runs twice for the same HWND.
  • It can result when registration failed earlier but teardown still assumes success.
  • It can result when the HWND was destroyed and recreated, so the new handle generation was never registered.

Troubleshooting workflow

  1. Capture it at the first native return before a wrapper maps it to a generic exception.
  2. Identify the exact object, method, and lifecycle phase involved in unregistering a window during destruction, feature disablement, or target replacement.
  3. Track a successful RegisterDragDrop result as state owned by the window instance.
  4. Log WM_NCDESTROY and feature-toggle order around RevokeDragDrop.
  5. Confirm that the call runs on the thread and apartment that owns the window.
  6. Reproduce it with one controlled input or state change, and verify that the correction changes the decisive evidence rather than merely hiding the result.

What to log

A useful incident records the HWND value, creating thread, apartment type, registration state, IDropTarget identity, active drag sequence, mouse capture, and destruction or recreation events. Also retain the application and component build, architecture, process and thread IDs, COM apartment, operation correlation ID, elapsed time, and the first state-changing event before the failure. When logging it, redact content and credentials while preserving types, lengths, hashes, opaque identities, and lifecycle generations needed to reproduce its contract.

Correction strategy

Correction. for it, make revocation conditional on recorded successful registration and clear that state exactly once. Retry boundary. Do not retry blindly; either register the live window first or treat the duplicate teardown as an application-state defect. Before repeating the operation, finish or cancel any active drag, pair each successful registration with one revocation, and verify that the HWND still belongs to the same window generation.

Practical scenario

A view calls RevokeDragDrop from both its disable command and destructor; an atomic or UI-thread-owned registration flag prevents the second call. This isolates it within OLE drag-and-drop registration and modal tracking and provides a regression test for the stated correction.

Difference from related HRESULTs

DRAGDROP_E_ALREADYREGISTERED is the opposite lifecycle mismatch: registration is attempted while an active target already exists. Keep those outcomes separate in exception mappings, telemetry dimensions, user messages, and automated retry policy.

Developer and administrator guidance

Own registration state on the HWND’s UI thread, tie it to the window generation, and guard DoDragDrop against reentrant starts. Regression coverage for it should include duplicate enable and disable paths, HWND recreation, framework-owned drop targets, destruction during registration, and nested input dispatch while a drag is active.

Operational repair for it must target the evidence-backed owner: identify whether the application, UI framework, shell extension, or plugin owns the target before changing configuration; machine-wide COM repair is not justified by a per-window lifecycle defect. Retain before-and-after traces for it so the change can be attributed and reversed.

References


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