XP CFileDialog & RichEdit multithreaded app
-
I have an app whs entering MTA instead STA by calling HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); Now on Windows XP OS all common openfile dialogs behave 'microsoft way' Any FileOpen Dialog even the style is OFN_EXLORER, or not, or even I am using extended structure to get the XP left crap I get folowings. Current browsing folder have only bmp files. In FileType Combobox I have 2 file filters, eg. (*.bmp) and (*jpg) Default selection is bmp. I see the bmp files in the listview. I am changing the File Types: to jpg. The list view is empty. Now I change back to bmp. The list box is still empty !!!. There is no way to repopulate the list view unless I type explicit the *.bmp in the File Name Edit Control. Also none of the rich edit controls work. They crash. If I join a STA CoInitialize() everithing is OK but I need the MTA. If you know any work around couse I searched at msdn and ... Thank you.
-
I have an app whs entering MTA instead STA by calling HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); Now on Windows XP OS all common openfile dialogs behave 'microsoft way' Any FileOpen Dialog even the style is OFN_EXLORER, or not, or even I am using extended structure to get the XP left crap I get folowings. Current browsing folder have only bmp files. In FileType Combobox I have 2 file filters, eg. (*.bmp) and (*jpg) Default selection is bmp. I see the bmp files in the listview. I am changing the File Types: to jpg. The list view is empty. Now I change back to bmp. The list box is still empty !!!. There is no way to repopulate the list view unless I type explicit the *.bmp in the File Name Edit Control. Also none of the rich edit controls work. They crash. If I join a STA CoInitialize() everithing is OK but I need the MTA. If you know any work around couse I searched at msdn and ... Thank you.
RIch Edit is still screwed up at least I solve it with the dialog: BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { BOOL ret = CFileDialog::OnNotify(wParam, lParam, pResult); OFNOTIFY* pNotify = (OFNOTIFY*)lParam; switch(pNotify->hdr.code) { case CDN_TYPECHANGE: { CWnd* pWnd = GetActiveWindow(); CWnd* PDlg = pWnd; if(pWnd) { GetFocus()->PostMessage(WM_KEYDOWN,VK_RETURN,0); GetFocus()->PostMessage(WM_KEYUP,VK_RETURN,0); } } break; } return ret; }