• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Drag and Drop problems in MFC

I am trying to enable drag and drop in my MFC application. I am dragging elements from a tree control to a list control and I am processing the following messages:
TVN_BEGINDRAG
WM_MOUSEMOVE
LBUTTONUP

Everything works fine in debug mode but the release executable crashes as soon as I drag an item. Has anyone come across this issue before?
0
top-gun
Asked:
top-gun
2 Solutions
 
AndyAinscowCommented:
>>>Everything works fine in debug mode but the release executable crashes

Sounds like an error in code - have you iniitialised all variables? (The debug mode build does it automatically, release mode does NOT).
0
 
top-gunAuthor Commented:
Thanks for your reply. It turned out to be an issue with message reflection which was causing the release version to crash.

I was using the following to detect dragging:
ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnTvnBegindrag)

Changing this to following fixed the issue:
ON_NOTIFY_REFLECT_EX(TVN_BEGINDRAG, OnTvnBegindrag)

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now