computerwhiz
Programmer
I cannot figure out what I am doing wrong. I cannot get my program to pull the file name from the dropped files structure. I am using dev-cpp and I am getting the error:
97 C:\WINDOWS\Desktop\mysourceC++\main.cpp
invalid conversion from `void*' to `HDROP__*'
msdn.com says this is the way to attain the structure. I am confused. help please.
97 C:\WINDOWS\Desktop\mysourceC++\main.cpp
invalid conversion from `void*' to `HDROP__*'
msdn.com says this is the way to attain the structure. I am confused. help please.
Code:
case WM_DROPFILES:
{
HDROP hDrop;
hDrop = (HANDLE) wParam;
LPTSTR lpszFile;
DragQueryFile(
hDrop, // handle of structure for dropped files
0, // index of file to query
lpszFile, // buffer for returned filename
sizeof(lpszFile) // size of buffer for filename
);
SetWindowText(GetDlgItem(hwnd, IDC_MAIN_TEXT), lpszFile);
DragFinish(hDrop);
break;
}