I have a dialog that accepts a Drag&Drop of a file. I have it working, without a problem, in the IDE while testing. I can compile it without error. But when I try it from the EXE, it crashes the program.

Putting some windows prompts, I can see that it goes through the entire Drag&Drop routine without a problem but when that function apparently ends, that is where it crashes.

Here's the code:
Code:
class CMayDlg : public CDialog
{
// Construction
public:
	CString m_sFiles;
	void OnDropFiles(HDROP hdrop);
        ...

};





BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
	//{{AFX_MSG_MAP(CMyDlg)
        ...
	ON_MESSAGE(WM_DROPFILES,OnDropFiles)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

void CMyDlg::OnDropFiles(HDROP hdrop)
{
	UINT uNumFiles;
	TCHAR szNextFile[8096];

	UpdateData(true);

	// Get the # of files being dropped.
	uNumFiles = DragQueryFile ( hdrop, -1, NULL, 0 );


	m_sFiles="";

	for ( UINT uFile = 0; uFile < uNumFiles; uFile++ )
	{
		// Get the next filename from the HDROP info.
		if ( DragQueryFile ( hdrop, uFile, szNextFile, 8096 ) > 0 )
		{
			m_sFiles += szNextFile;
			m_sFiles +="\r\n";
		}
	}

	// Free up memory.
	DragFinish ( hdrop );
}
As said, I am at a loss. Not sure if this is a VC++ v6 bug or I accidentally overlooked something. Not sure how to debug this any further because I am leaving the "called" routine via the WM_MESSAGE. It's something after that that is crashing it appears.

Any help is greatly appreciated.