Hi guys, There is a small bug in this great class (v3.9) and I'm puzzled on how to fix it. Its regarding tooltips: Once a tooltip is enabled on a button it works fine. You hover over the button and, as expected, the tooltip is displayed. But, once the button has been pressed the tooltip dissapears never to be seen again! Any help would be...well, helpfull :-O
GrumbleWeedster
Posts
-
CButtonST bug, any fix? -
DoModal in DropFiles Error ?!Dialog based applications can't seem to handle drop files that way. Nothing is ever added to the list when items are dropped. The only way I've found to enable drag and drop in a dialog based app is intercept the message in
PreTranslateMessage()
-
DoModal in DropFiles Error ?!I may have found a solution but can anyone tell me if it could cause a problem? Changing the code in
PreTranslateMessage(MSG* pMsg)
stopped the error from occuring: Original Code: (Not Working)if( pMsg->message == WM_DROPFILES) OnDropFiles(pMsg->wParam,pMsg->lParam); return CDialog::PreTranslateMessage(pMsg);
Modified Code: (Working)if( pMsg->message == WM_DROPFILES) { OnDropFiles(pMsg->wParam,pMsg->lParam); ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; } else return CDialog::PreTranslateMessage(pMsg);
As I said, this does make the function work correctly, but is it a solution or is it just diverting from the error? -
DoModal in DropFiles Error ?!Nothing. At the moment CFileReplace is an empty default dialog with and OK and Cancel button. There are no custom functions in place yet because I need to get around the initial error.
-
DoModal in DropFiles Error ?!At this moment it isn't returning a value because of the current problem, it's still a plain dialog box with an OnOK() to close.
-
DoModal in DropFiles Error ?!it exits with OnOK()
-
DoModal in DropFiles Error ?!int RetVal; int nFiles = DragQueryFile(hDrop, -1, szDroppedFile, 2048); for(int i=0;i-1) // if x>-1 a duplicate filename already exists { CFileReplace md; md.ReturnValue=&RetVal; md.DoModal(); // Depending on RetVal value either replace the file or skip ... } ...
If I comment out the 3 lines regarding the CFileReplace function and assign a value to RetVal the function works fine, it's only by calling DoModal that the error occurs. -
DoModal in DropFiles Error ?!The assert is coming from wincore.cpp (void CWnd::AssertValid() const) If I comment out the domodal part of the code it works fine, it's only when domodal is called that the problem occurs at the end of the function.
void CWnd::AssertValid() const { if (m_hWnd == NULL) return; // null (unattached) windows are valid // check for special wnd??? values ASSERT(HWND_TOP == NULL); // same as desktop if (m_hWnd == HWND_BOTTOM) ASSERT(this == &CWnd::wndBottom); else if (m_hWnd == HWND_TOPMOST) ASSERT(this == &CWnd::wndTopMost); else if (m_hWnd == HWND_NOTOPMOST) ASSERT(this == &CWnd::wndNoTopMost); else { // should be a normal window **ASSERT(::IsWindow(m_hWnd));** // should also be in the permanent or temporary handle map CHandleMap* pMap = afxMapHWND(); ASSERT(pMap != NULL);
-
DoModal in DropFiles Error ?!Hi, I've coded a dialog based app that allows you to drop files into a listbox. Once the drop has taken place I've written some code to check if the files dropped are already listed in the lisbox - and if so a dialog box shows asking the user if they want to replace their existing files (pretty much like windows explorer). My problem is, everything works fine until the end of the DropFiles function is reached..when it returns the program crashes from the following Assert:
ASSERT(::IsWindow(m_hWnd));
Anyone know how to fix this? :confused: Thanks in advance. -
Another Drag and Drop QuestionI'm in the process of writing a 'winzip' style tool. I want to enable drag and drop so the user can drag files from my tool and drop them into win explorer. The problem is I need to extract the files before the final 'drop' can take place. I'm using COleDataSource::DoDragDrop to do the job but as it's a single function that does the drag and the drop I cannot extract the files to a temp folder before the process finishes! Basiclly, I make a list of the files the user has dragged, create 0 byte files in a temp folder to fill in the DROPFILES struct but when I drop the function simply copies the 0 byte files before I can replace them with the extracted ones! Any help would be appriciated as I've been pulling my hair out and dont have much left! :wtf: Thanks :)