Click here to Skip to main content
15,888,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHelp with regular/extension MFC dll Pin
Dudi Avramov30-Nov-04 6:15
Dudi Avramov30-Nov-04 6:15 
GeneralClipping regions Pin
Rassul Yunussov30-Nov-04 6:13
Rassul Yunussov30-Nov-04 6:13 
GeneralRe: Clipping regions Pin
PJ Arends30-Nov-04 11:32
professionalPJ Arends30-Nov-04 11:32 
GeneralDCOM Pin
Rassul Yunussov30-Nov-04 6:11
Rassul Yunussov30-Nov-04 6:11 
GeneralRe: DCOM Pin
David Crow30-Nov-04 8:08
David Crow30-Nov-04 8:08 
GeneralRe: DCOM Pin
Rassul Yunussov30-Nov-04 18:40
Rassul Yunussov30-Nov-04 18:40 
GeneralWIndows Sucks...GetOpenFileName COInitializeEx(COINIT_MULTITHREADED) Pin
suiram4030-Nov-04 5:54
suiram4030-Nov-04 5:54 
GeneralI found the work Pin
suiram4030-Nov-04 7:24
suiram4030-Nov-04 7:24 
around.:
[code]
class COd : public CFileDialog
{
public:

COd(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL):CFileDialog(bOpenFileDialog,
lpszDefExt ,
lpszFileName ,
dwFlags ,
lpszFilter ,
0 )
{
}

int DoModal(){

return CFileDialog::DoModal();
}

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;
}

virtual void OnFolderChange()
{
TCHAR cs[128];
CWnd* pWnd = GetActiveWindow();
CWnd* PDlg = pWnd;
CWnd* PSlv = 0;
int relation = GW_CHILD|GW_HWNDFIRST;
while(pWnd = pWnd->GetWindow(relation))
{
GetClassName(pWnd->m_hWnd, cs,128);
if(!strcmp("SHELLDLL_DefView",cs))
{
CWnd* pSave = pWnd;
int relation = GW_CHILD|GW_HWNDFIRST;
while(pWnd = pWnd->GetWindow(relation))
{
GetClassName(pWnd->m_hWnd, cs,128);
if(!strcmp("SysListView32",cs))
{
PSlv = pWnd;
break;
}
relation = GW_HWNDNEXT;
}
pWnd = pSave;
}
relation = GW_HWNDNEXT;
}


}

};


class DlgWrap
{
public:
DlgWrap(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL)
{
memset(&m_ofn,0,sizeof(m_ofn));
_cfilter = lpszFilter;
_cfilter.Replace('|', '\0');


m_ofn.lStructSize = sizeof(m_ofn);
m_ofn.lpstrDefExt = lpszDefExt;
m_ofn.lpstrFile = (LPTSTR)lpszFileName;
m_ofn.Flags = dwFlags ;//| OFN_EXPLORER;
m_ofn.lpstrFileTitle = "asdfasd";
m_ofn.lpstrFilter = (LPCTSTR)_cfilter ;
/*
m_ofn.nMaxFileTitle = MAX_PATH;
m_ofn.hwndOwner = pParentWnd->m_hWnd;
m_ofn.lpstrFilter = lpszFilter;
*/
//// m_ofn.Flags = dwFlags | OFN_EXPLORER;
//// strFilter.Replace('|', '\0');


}

UINT DoModal()
{
_hThread = ::CreateThread(0,0,(LPTHREAD_START_ROUTINE)ThrProc,this,0,0);
Sleep(1208);
WaitForSingleObject(_hThread, INFINITE);
return _rv;
}

static UINT ThrProc(void* pThis)
{
OPENFILENAME ofn = {0};
DlgWrap* pDlg = (DlgWrap*)pThis;
HRESULT hr = CoInitialize(0);
memcpy(&ofn, &pDlg->m_ofn, sizeof(ofn));
pDlg->_rv = ::GetOpenFileName(&ofn);
memcpy(&pDlg->m_ofn, &ofn, sizeof(ofn));
CoUninitialize();
return pDlg->_rv;
}

DWORD _rv;
HANDLE _hThread;
OPENFILENAME m_ofn;
CString _cfilter ;
};


[/code]
GeneralDisabling ListCtrl Item Pin
brianwelsch30-Nov-04 4:19
brianwelsch30-Nov-04 4:19 
GeneralRe: Disabling ListCtrl Item Pin
alex.barylski30-Nov-04 7:37
alex.barylski30-Nov-04 7:37 
GeneralRe: Disabling ListCtrl Item Pin
alex.barylski30-Nov-04 7:38
alex.barylski30-Nov-04 7:38 
GeneralLabelling Objects Pin
gilazilla30-Nov-04 3:56
gilazilla30-Nov-04 3:56 
GeneralName and path of exe (or dll) Pin
Einar Kvandahl30-Nov-04 3:31
Einar Kvandahl30-Nov-04 3:31 
GeneralRe: Name and path of exe (or dll) Pin
Steve S30-Nov-04 3:37
Steve S30-Nov-04 3:37 
GeneralRe: Name and path of exe (or dll) Pin
Einar Kvandahl30-Nov-04 3:56
Einar Kvandahl30-Nov-04 3:56 
GeneralRe: Name and path of exe (or dll) Pin
Iain Clarke, Warrior Programmer30-Nov-04 4:11
Iain Clarke, Warrior Programmer30-Nov-04 4:11 
GeneralRe: Name and path of exe (or dll) Pin
Einar Kvandahl30-Nov-04 4:37
Einar Kvandahl30-Nov-04 4:37 
GeneralTree Item Color Pin
Neelesh K J Jain30-Nov-04 2:03
Neelesh K J Jain30-Nov-04 2:03 
GeneralRe: Tree Item Color Pin
Iain Clarke, Warrior Programmer30-Nov-04 2:09
Iain Clarke, Warrior Programmer30-Nov-04 2:09 
GeneralRe: Tree Item Color Pin
Neelesh K J Jain1-Dec-04 0:18
Neelesh K J Jain1-Dec-04 0:18 
QuestionFIFO buffer settings for serial ports ? Pin
olczyk_michael30-Nov-04 1:38
olczyk_michael30-Nov-04 1:38 
AnswerRe: FIFO buffer settings for serial ports ? Pin
Iain Clarke, Warrior Programmer30-Nov-04 2:04
Iain Clarke, Warrior Programmer30-Nov-04 2:04 
GeneralProblems to add title in a split Frame Pin
Member 152995930-Nov-04 1:34
Member 152995930-Nov-04 1:34 
GeneralVC-7 ATL classes in VC-6 Pin
Imtiaz Murtaza30-Nov-04 1:33
Imtiaz Murtaza30-Nov-04 1:33 
GeneralRe: VC-7 ATL classes in VC-6 Pin
BlackDice30-Nov-04 6:32
BlackDice30-Nov-04 6:32 

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.