I have the following piece of code which returns the handle to the window which should receive the focus, CWnd* pWndNewFocus = GetNextTabStopWnd(pWndCurrentFocus->;GetSafeHwnd(), iDirection); For setting the focus to the new window, i've written the following code, pWndNewFocus->SetFocus(); Incidentally the window that is set to receive the focus is a CButton. I have an OK button which is default button and a Cancel button. OK button is dithered. So the pWndNewFocus will be my Cancel button. When SetFocus is getting called on that, i'm not able to see the focus [dotten line around the caption] on the button. Could you let me know the reason for this error? The same code when I execute it from VC++ 6.0, the focus is correctly getting set to the button. But when i execute the code in VC++ 10, i'm getting this issue.
vikram attiganal
Posts
-
SetFocus API in MFC -
Text getting truncatedI need the text to be displayed on multiple lines, but i need to avoid text truncation.
-
Text getting truncatedHello, I am finding an issue where in I have a Text which is longer than a single line with no spaces. This text is not displayed completely in the tool tip. It gets truncated. I make use of CDC for the tooltip display rectangle, CDC* pDC = GetDC(); CRect rect(0, 0, 0, 0); CString sComment = "this is a comment bigggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg comment 2 2 2"; pDC->DrawText(sComment, &rect, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_TOP); int iheight = rect.Height(); // It wont return the correct rectangle height //Output is this is a comment biggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg Can anyone tell me what the issue is. Thank you, ~ Vikram
-
Please help, its very urgent ( retrieving datetime )Use the Format() method to format it in whatever way you want. Like Format("%Y-%m-%d") formats it to Year, Month and Day format. Format method is member of CTime class.
-
need help!!!!Try Desc "tablename" query. Get the recordcount from the recordset. The count you get is the column count.
-
Finding a file/* Check for existence */ if( (_access( "filename, with full path", 0 )) != -1 ) { //file exists } This will do the trick for you
-
CDaodatabaseCDaoDatabase constructs a CDaoDatabase object. The path to the database will have to be provided and connection can be opened with Open() method.
-
How to Run only One Instance of my Application at a time//---------------------------------------------------------------------------------------------------// //check if the application is already running... bool bAlreadyRunning; HANDLE hMutexOneInstance = CreateMutex( NULL, TRUE, "Pointer to a null-terminated string specifying the name of the mutex object."); bAlreadyRunning = ( GetLastError() == ERROR_ALREADY_EXISTS ); if ( hMutexOneInstance ) { ReleaseMutex( hMutexOneInstance ); } if ( bAlreadyRunning ) { //AfxMessageBox("Application is already running"); return FALSE; } //---------------------------------------------------------------------------------------------------// Include this code in the InitInstance of your app. This will do the trick for you.