Click here to Skip to main content
15,887,410 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListCtrl::SetItemCountEx Pin
jmkhael30-Sep-02 0:43
jmkhael30-Sep-02 0:43 
GeneralRecv issue Pin
John Bosko30-Sep-02 0:14
John Bosko30-Sep-02 0:14 
GeneralRe: Recv issue Pin
jmkhael30-Sep-02 0:27
jmkhael30-Sep-02 0:27 
GeneralSHBrowseForFolder Pin
viliam30-Sep-02 0:13
viliam30-Sep-02 0:13 
GeneralRe: SHBrowseForFolder Pin
jmkhael30-Sep-02 0:49
jmkhael30-Sep-02 0:49 
GeneralRe: SHBrowseForFolder Pin
Leifen30-Sep-02 1:20
Leifen30-Sep-02 1:20 
GeneralCFileDialog Pin
viliam30-Sep-02 0:12
viliam30-Sep-02 0:12 
GeneralRe: CFileDialog Pin
Roman Fadeyev30-Sep-02 2:12
Roman Fadeyev30-Sep-02 2:12 
Use that:
class CFileDialogEx : public CFileDialog  
....


#pragma pack(4)            // n=4
int CFileDialogEx::DoModal()
{
	struct OPENFILENAMEEX 
	{
		OPENFILENAME of; 
		void *		pvReserved;
		DWORD		dwReserved;
		DWORD		FlagsEx;
	};
	OSVERSIONINFO osvi= {sizeof(OSVERSIONINFO)} ;
	bool Win2000=false;
	#if _MSC_VER < 1300	//В .NET идет станлартная реализация в MFC
		Win2000=(GetVersionEx (&osvi)) && 
			(((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5)) ||
			((osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS) && (osvi.dwMajorVersion >= 4) && (osvi.dwMinorVersion >= 90)));
	#endif
	
	if (Win2000)
	{
		ASSERT_VALID(this);
		ASSERT(m_ofn.Flags & OFN_ENABLEHOOK);
		ASSERT(m_ofn.lpfnHook != NULL); // can still be a user hook
		
		// zero out the file buffer for consistent parsing later
		ASSERT(AfxIsValidAddress(m_ofn.lpstrFile, m_ofn.nMaxFile));
		DWORD nOffset = lstrlen(m_ofn.lpstrFile)+1;
		ASSERT(nOffset <= m_ofn.nMaxFile);
		memset(m_ofn.lpstrFile+nOffset, 0, (m_ofn.nMaxFile-nOffset)*sizeof(TCHAR));
		
		// WINBUG: This is a special case for the file open/save dialog,
		//  which sometimes pumps while it is coming up but before it has
		//  disabled the main window.
		HWND hWndFocus = ::GetFocus();
		BOOL bEnableParent = FALSE;
		m_ofn.hwndOwner = PreModal();
		AfxUnhookWindowCreate();
		if (m_ofn.hwndOwner != NULL && ::IsWindowEnabled(m_ofn.hwndOwner))
		{
			bEnableParent = TRUE;
			::EnableWindow(m_ofn.hwndOwner, FALSE);
		}
		
		_AFX_THREAD_STATE* pThreadState = AfxGetThreadState();
		ASSERT(pThreadState->m_pAlternateWndInit == NULL);
		
		if (m_ofn.Flags & OFN_EXPLORER)
			pThreadState->m_pAlternateWndInit = this;
		else
			AfxHookWindowCreate(this);
		
		int nResult;
		OPENFILENAMEEX ofn_ex={0};
		memcpy(&ofn_ex.of,&m_ofn,sizeof(m_ofn));
		ofn_ex.of.lStructSize=sizeof(OPENFILENAMEEX);
		
		if (m_bOpenFileDialog)
			nResult = ::GetOpenFileName((LPOPENFILENAME)&ofn_ex);
		else
			nResult = ::GetSaveFileName((LPOPENFILENAME)&ofn_ex);
		memcpy(&m_ofn,&ofn_ex.of,sizeof(m_ofn));
		
		if (nResult)
			ASSERT(pThreadState->m_pAlternateWndInit == NULL);
		pThreadState->m_pAlternateWndInit = NULL;
		
		// WINBUG: Second part of special case for file open/save dialog.
		if (bEnableParent)
			::EnableWindow(m_ofn.hwndOwner, TRUE);
		if (::IsWindow(hWndFocus))
			::SetFocus(hWndFocus);
		
		PostModal();
		return nResult ? nResult : IDCANCEL;
	}
	else
		return CFileDialog::DoModal();
}
#pragma pack()

Generalmfc dll and resources Pin
Zizilamoroso29-Sep-02 23:37
Zizilamoroso29-Sep-02 23:37 
GeneralRe: mfc dll and resources Pin
Stephane Rodriguez.30-Sep-02 0:03
Stephane Rodriguez.30-Sep-02 0:03 
GeneralRe: mfc dll and resources Pin
Zizilamoroso30-Sep-02 1:25
Zizilamoroso30-Sep-02 1:25 
Generalmfc dll and resources - UPDATE Pin
Zizilamoroso30-Sep-02 1:30
Zizilamoroso30-Sep-02 1:30 
Questionwhich Db option? Pin
bryce29-Sep-02 22:10
bryce29-Sep-02 22:10 
QuestionHow can I remove popup menu in CHtmlView? Pin
sonshiro29-Sep-02 21:01
sonshiro29-Sep-02 21:01 
AnswerRe: How can I remove popup menu in CHtmlView? Pin
bryce29-Sep-02 22:33
bryce29-Sep-02 22:33 
Generalremoving separator in CComboBox Pin
yourbuddy7729-Sep-02 20:55
yourbuddy7729-Sep-02 20:55 
GeneralFormat strings and iostream Pin
Patje29-Sep-02 20:45
Patje29-Sep-02 20:45 
GeneralRe: Format strings and iostream Pin
benjymous30-Sep-02 0:05
benjymous30-Sep-02 0:05 
GeneralRe: Format strings and iostream Pin
Patje30-Sep-02 6:05
Patje30-Sep-02 6:05 
GeneralRe: Format strings and iostream Pin
jbarton30-Sep-02 7:08
jbarton30-Sep-02 7:08 
Questionfile manage, private property of microsoft? Pin
includeh1029-Sep-02 20:25
includeh1029-Sep-02 20:25 
AnswerRe: file manage, private property of microsoft? Pin
Andreas Saurwein30-Sep-02 3:27
Andreas Saurwein30-Sep-02 3:27 
GeneralCDocument, help!!!! Pin
includeh1029-Sep-02 20:08
includeh1029-Sep-02 20:08 
GeneralRe: CDocument, help!!!! Pin
jhwurmbach29-Sep-02 21:27
jhwurmbach29-Sep-02 21:27 
GeneralCOM related Pin
Shamoon29-Sep-02 18:59
Shamoon29-Sep-02 18:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.