Click here to Skip to main content
15,900,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: automatically click a button in another application Pin
David Crow15-Oct-08 10:57
David Crow15-Oct-08 10:57 
AnswerRe: automatically click a button in another application Pin
Russell'15-Oct-08 11:28
Russell'15-Oct-08 11:28 
GeneralRe: automatically click a button in another application Pin
Russell'15-Oct-08 11:57
Russell'15-Oct-08 11:57 
QuestionSpin Control Pin
WayneK10015-Oct-08 9:03
WayneK10015-Oct-08 9:03 
AnswerRe: Spin Control Pin
David Crow15-Oct-08 10:58
David Crow15-Oct-08 10:58 
QuestionWhy the activex .ocx can't find msvcr80.dll & mfc80.dll even if I install the 2005 sp1 redist.exe ? Pin
oppstp15-Oct-08 7:11
oppstp15-Oct-08 7:11 
GeneralRe: Why the activex .ocx can't find msvcr80.dll & mfc80.dll even if I install the 2005 sp1 redist.exe ? Pin
oppstp16-Oct-08 0:07
oppstp16-Oct-08 0:07 
QuestionMFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 5:37
Keith (MapMan)15-Oct-08 5:37 
I have an MFC, multi-document template application, built using Visual Studio 6, which has been working for a long time now. Recently I moved to a new development machine and now my application hangs whenever I click the File menu and choose Open.

I have run it in debug mode and traced into the MFC code. The point of failure is in DlgFile.cpp(part of Microsoft's MFC source) at line 108 where it calls ::GetOpenFileName(&m_ofn). It goes in there never to return.

I spotted that the m_ofn structure points at a hook function _AfxCommDlgProc so I set a break point in that. The dialog receives the following windows messages before the application hangs: WM_SETFONT, WM_INITDLG, WM_SHOWWINDOW, WM_WINDOWPOSCHANGING, WM_NCCALCSIZE, WM_CHILDACTIVATE, WM_WINDOWPOSCHANGED then WM_SIZE. The WM_SIZE message is processed OK and AfxCommDlgProc then exits back to code for which source is unavailable. My dialog never receives another message.

As a control I then tried exactly the same experiment on another MFC application of mine - one which doesn't fail. It acts exactly the same except that the WM_SIZE message is followed (after a short but noticable delay) by a WM_SETREDRAW after which the Open File dialog box appears.

If I let the failing application hang then click on Debug, Break, the call stack is singularly uninformative:
NTDLL! 7c90eb94()
USER32! 7e4195f9()
USER32! 7e4196a8()
BROWSEUI! 75f8afc9()
BROWSEUI! 75f8b591()
SHLWAPI! 77f69588()
NTDLL! 7c927545()
NTDLL! 7c927583()
NTDLL! 7c927645()
NTDLL! 7c92761c()
KERNEL32! 7c80b683()

I am at my wits end. I am using the standard MFC file open mechanism with no undue cleverness. I can see no tangible difference between the failing application and a different application which works, apart from the file types it's looking for. Has anyone any sensible suggestions what to try next?

Keith
QuestionRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Mark Salsbery15-Oct-08 6:04
Mark Salsbery15-Oct-08 6:04 
AnswerRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 6:12
Keith (MapMan)15-Oct-08 6:12 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Mark Salsbery15-Oct-08 6:22
Mark Salsbery15-Oct-08 6:22 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 6:45
Keith (MapMan)15-Oct-08 6:45 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Mark Salsbery15-Oct-08 6:54
Mark Salsbery15-Oct-08 6:54 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 7:12
Keith (MapMan)15-Oct-08 7:12 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 22:55
Keith (MapMan)15-Oct-08 22:55 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Mark Salsbery16-Oct-08 4:14
Mark Salsbery16-Oct-08 4:14 
QuestionRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
David Crow15-Oct-08 7:23
David Crow15-Oct-08 7:23 
AnswerRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 22:40
Keith (MapMan)15-Oct-08 22:40 
QuestionRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Cosmic Egg15-Oct-08 6:07
Cosmic Egg15-Oct-08 6:07 
AnswerRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
jeron115-Oct-08 6:17
jeron115-Oct-08 6:17 
AnswerRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Keith (MapMan)15-Oct-08 6:21
Keith (MapMan)15-Oct-08 6:21 
GeneralRe: MFC App (Visual Studio 6) hangs when you click File, Open. Pin
Cosmic Egg15-Oct-08 6:34
Cosmic Egg15-Oct-08 6:34 
QuestionAnalysing dump files Pin
rajandpayal15-Oct-08 4:53
rajandpayal15-Oct-08 4:53 
QuestionCompare two icons(.gif) Pin
Subrat 470826615-Oct-08 3:43
Subrat 470826615-Oct-08 3:43 
AnswerRe: Compare two icons(.gif) Pin
Subrat 470826615-Oct-08 3:43
Subrat 470826615-Oct-08 3:43 

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.