IE & TABS - I do not get tabs!

Hello to all,
I've found a problem and have no ideas how to sove it.
The situation is the following:
There is huge project, that was and is developing using MBCS encoding option. Setting option into Unicode takes approximately 5K errors and warnings. Some time ago it it bacame a task to have an ability to select unicode-named files. The projects uses standart CFileDialog and as it is compiled under MBCS, such a class uses OPENFILENAMEA struct. As the result, I cannot get normal filename. Of cource, I can use ::GetOpenFileNameW with OPENFILENAMEW argument. But in some cases CFileDialog is combined with another dialog to give preview option. In such case I need to write my own hook procedure to handle all messages. At this time I have no so much time and skills to do this.

I've tried to write a CFileDialog wrapper and put it into MFC-extention DLL, compiled under Unicode, but in CFileDialog constructor (as a base class) happends and assertion on AfxGetResourceHandle. I do not now the reason.

Any ideas

Thanks in advance,
Andrew




Answer this question

IE & TABS - I do not get tabs!

  • Blipwort

    • mfc71ud.dll!AfxGetResourceHandle() Line 26 + 0x1e C++
    • mfc71ud.dll!CFileDialog::CFileDialog(int bOpenFileDialog=0, const wchar_t * lpszDefExt=0x00000000, const wchar_t * lpszFileName=0x00000000, unsigned long dwFlags=6, const wchar_t * lpszFilter=0x00000000, CWnd * pParentWnd=0x00000000, unsigned long dwSize=88) Line 67 + 0x5 C++
    • UnicodeFileDialogDll.dll!1001256a()
    • DllTest.exe!CDllTestDlg::OnBnClickedButton1() Line 89 + 0x1d C++
    • DllTest.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x0012fdbc, unsigned int nID=1000, int nCode=0, void (void)* pfn=0x0047f7fe, void * pExtra=0x00000000, unsigned int nSig=53, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 89 C++
    • DllTest.exe!CCmdTarget::OnCmdMsg(unsigned int nID=1000, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 396 + 0x27 C++
    • DllTest.exe!CDialog::OnCmdMsg(unsigned int nID=1000, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Line 88 + 0x18 C++
    • DllTest.exe!CWnd::OnCommand(unsigned int wParam=1000, long lParam=4721294) Line 2550 C++
    • DllTest.exe!CWnd::OnWndMsg(unsigned int message=, unsigned int wParam=, long lParam=, long * pResult=) Line 1759 + 0x1c C++


  • Martimus

    It's Vista announcement forum. Please ask IE related questions in the IE group.

    I move you post to there now.



  • j_o_h_a_n_n_e_s

    MFC ver. 7.0

    Here is the code fragment from CFileDialog::CFileDialog(....)

    ......
    m_ofn.lpstrFileTitle = (LPTSTR)m_szFileTitle;
    m_ofn.nMaxFileTitle = _countof(m_szFileTitle);
    m_ofn.Flags |= dwFlags | OFN_ENABLEHOOK | OFN_EXPLORER;
    if(dwFlags & OFN_ENABLETEMPLATE)
    m_ofn.Flags &= ~OFN_ENABLESIZING;
    m_ofn.hInstance = AfxGetResourceHandle();
    m_ofn.lpfnHook = (COMMDLGPROC)_AfxCommDlgProc;
    .......

    The hightlightened code line exec. result is assertion!

    The situation looks like i need to use AFX_MANAGE_STATE macro, but I cannot understand where I should place it (Dll exports a CFileDialog_wrapper_class only)

  • nextpaco

    No this is your code. Were in the MFC is the ASSERT. Give aus evuntually infos about the callstack.

    You wrote that you have a MFC Extension DLL, so this can not be the reason! There is no need to AFX_MANAGE_STATE in an MFC extension DLL.

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/vclib/html/_mfcnotes_tn058.asp



  • Amit Bansal

    Andrew Lisogor wrote:

    I've tried to write a CFileDialog wrapper and put it into MFC-extention DLL, compiled under Unicode, but in CFileDialog constructor (as a base class) happends and assertion on AfxGetResourceHandle.

    This assertation is thrown usually because of DLL not having resources. In case if you have a customized dialog for File-Open, it is not in this DLL. Have you tried opening this DLL in Visual Studio and see if corresponding resources are available Also if this is MFC extension DLL, it should be consumed by MFC app with CWinApp declared. You may also manually store DLL instance in a global variable from DllMain() and then use it.

    But overall it is very hard to diagnose this issue without a sample project. Try narrowing down this to a simple one file DLL and posting source code. You may find more MFC developers on MFC newsgroups, http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US

    Cheers,

    Nikola



  • twospoons

    I downloaded and installed 7.0.5730.11 from the official MS download site.

    I do not seem to have TABs: if i follow links then i simply get new windows opening as before in IE6.

    I do not have a TABs icon in the menu bar.

    I searched HELP and entering TABS gives nothing!

    In reading a MS article i noticed the phrase "tab browsing - off" but i cannot seem to find any switch from the tools menu. (I have a tick in the box to say tab browsing enabled in the GENERAL section of TOOLS>Internet Options.

    It seems that i cannot see wood for trees.... i feel an idiot... can anyone help ...PLEASE

    Pete


  • Paul Gerald

    Any another ideas
    I believe, that solution exists, but cannot find it

  • Zakamon

    Still cannot find a solution
    Can anybody help

  • Alibong

    My tip: switch to unicode and fix the problems.

    What MFC Version are you using Where is the ASSERT fired



  • Syed Faraz Mahmood

    The same problem: http://groups.google.com.ua/group/comp.os.ms-windows.programmer.tools.mfc/browse_thread/thread/ea23aae3ff95d0e2/8045675fcb1c9cdc%238045675fcb1c9cdc sa=X&oi=groupsr&start=1&num=2

  • DearME

    Tools, Internet Options, General Tab. At the bottom you will see the option for tabbed browsing. Click on Settings, and make certain that the option for Enable Tabbed browsing is selected.



  • IE & TABS - I do not get tabs!