Created and editable CListCtrl. Trying to subclass CDateTimeCtrl - unable to handle using VK_TAB and forcing the subclassed control to lose focus and destroy itself. Reasoning: When using the drop-down, obviously, CDateTimeCtrl loses focus, but can't figure out how to keep control visible until all user intervention is complete - or naturally, it loses focus to the next column, or other object. I tried overiding OnKillFocus: void CdtkDate::OnKillFocus(CWnd* pNewWnd) { CDateTimeCtrl::OnKillFocus(pNewWnd); CMonthCalCtrl* pMonCalCtrl = this->GetMonthCalCtrl(); // But CMonthCalCtrl doesn't get focus until the user selects it, // Even though it is visible - should I force this focus? if(pNewWnd->m_hWnd == pMonCalCtrl->m_hWnd) return; DestroyWindow(); } This Class will not always destroy itself - and I get an error when the application instance is terminated. Any suggestions will be appreciated.
Pir8ofTampa
Posts
-
Subclassing CDateTimeCtrl -
MFC and COM, and Access violation in CoUninitializeHave you determined that the COM server is indeed initialized? if(::CoInitialize()!=S_OK) MessageBox(_T("COM INIT FAILED"),NULL,MB_ICONERROR); ??
-
CDAORecordset::Find() troubleI myself have had difficulty with short date fields in MS Access. Possible Solutions: Verify (without reformatting) the COleDateTime value that is actually returned from your table. Mine have sometimes included time even though I have set it to be exclusively a date. Also becuase you are using a short date, you must use two digits to express the year so: str.Format("[ProductID] = '%s' AND [Date] = #%s#", m_pSet->m_strProductID, COleDateTime::GetCurrentTime().Format(_T("%#m/%#d/%y"))); Good luck.
-
Winsock ? AgainSorry, 'bout that, now I understand what you are asking. No you don't need SDK. Theoretically, constructing WsaData explicitly requires SockAddr_in struct but I had an instructor once who said that dynamic sockets are possible but never showed me how. Also, I've never tried to use a "Send" socket and a "Receive" socket (I assume this is what you are trying). I'll have to think more about this one using winsock2.
-
WinsockLike johnny said - use what you get in VS. Easiest and most preferred for beginners is to create a class derived from CAsyncSocket - and override SetParent function. I've tried other methods which are more in-depth, but still find this one the easiest and most straight-forward. Don't forget AfxSocketInit(). I did not write W32.Blaster quit asking.