Click to See Complete Forum and Search --> : WM_DROPFILES / DragQueryFile()


hixxy
March 18th, 2006, 10:28 PM
I have a GPF that I need to fix in this (part of a richedit window procedure):

case WM_DROPFILES:
{
HDROP query = (HDROP) wParam;
int n = 0, count = DragQueryFile( query, 0xFFFFFFFF, 0, 0 );
while ( n < count ) {
char ret[256];
char file[512];
DragQueryFile( query, n, file, 512 );
mIRCError( file );
n++;
}
DragFinish( query );
}
break;

mIRCError() is definitely not causing the problem and it's just a way of showing debug messages. All of the files are retrieved when I drag/drop a file but the program stops responding instantly afterwards. Does anybody know why?

Just to confuse the situation, this one works (part of my window's window procedure):

case WM_DROPFILES:
{
HDROP query = (HDROP) wParam;
int n = 0, count = DragQueryFile( query, 0xFFFFFFFF, 0, 0 );
while ( n < count ) {
char ret[256];
char file[512];
DragQueryFile( query, n, file, 512 );
mIRCError( file );
n++;
}
DragFinish( query );
}
break;

JohnCz
March 19th, 2006, 07:42 AM
Does anybody know why?
Not really until you provide cod that can be debugged.
Either post your project or try writing test app with rich edit window that will behave the same way and post it.

hixxy
March 19th, 2006, 10:14 AM
It doesn't matter now, I'm just going to forget about this. The exact same code works in treeview, listview, listbox, editbox and ipaddress, so I'm assuming there's a problem with the richedit.