Re: Visual Studio 2003 MFC wizard code fails to run

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Feb 8, 1:15 pm, Joseph M. Newcomer <newco...@xxxxxxxxxxxx> wrote:
So why didn't you say that?

Because I didn't know that, at the time. I was hoping that, as the
problem is with default code generated directly by VS and not modified
by me, it would be relatively easy to solve. As the code appears to
be identical across all copies of 2003, I didn't think reproducing it
would help.

It says nothing about an image file being in resource file. Not a word of the message
suggests this is the case. It says something a lot more explicit: it says that there is
no resource section in the image file, where "image file" means "executable image". That
says that there was something wrong in your build. For some reason it is unable to find
the resource segment. This never happens. When you say you "cannot find any images, not
even an icon for the form", what technique did you use for finding them? This might help
us analyze what is going on. Did you look at your Resource View? What is in its tree?

The phrase "specified image file" implies to me that an image file is
being specified. As I couldn't find any in the Resource View, I
assumed that meant there aren't any. I apologise for my ignorance on
the matter, but I can't learn any MFC until the example works.

I've created a brand new dialogue-based MFC project. Currently in the
resource view is one dialog, one icon, and one version page. I have
not modifed any of them.

I suggest doing a "rebuild all" or "rebuild solution", capture the output window, and post
that. At least it would be a start. We might spot something there that suggests what is
going wrong.

The build log for the brand new project:



Creating temporary file "d:\Profiles\shbridges.REST\My Documents
\cutlass\TestDialogue\Debug\RSP000001.rsp" with contents
[
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /D "_AFXDLL" /Gm /
EHsc /RTC1 /MDd /Zc:wchar_t /Yu"stdafx.h" /Fp"Debug/TestDialogue.pch" /
Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
".\TestDialogueDlg.cpp"
".\TestDialogue.cpp"
]
Creating command line "cl.exe @"d:\Profiles\shbridges.REST\My Documents
\cutlass\TestDialogue\Debug\RSP000001.rsp" /nologo"
Creating temporary file "d:\Profiles\shbridges.REST\My Documents
\cutlass\TestDialogue\Debug\RSP000002.rsp" with contents
[
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /D "_AFXDLL" /Gm /
EHsc /RTC1 /MDd /Zc:wchar_t /Yc"stdafx.h" /Fp"Debug/TestDialogue.pch" /
Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
".\stdafx.cpp"
]
Creating command line "cl.exe @"d:\Profiles\shbridges.REST\My Documents
\cutlass\TestDialogue\Debug\RSP000002.rsp" /nologo"
Creating command line "rc.exe /d "_DEBUG" /d "_AFXDLL" /l 0x409 /I
"Debug" /fo"Debug/TestDialogue.res" ".\TestDialogue.rc""
Creating temporary file "d:\Profiles\shbridges.REST\My Documents
\cutlass\TestDialogue\Debug\RSP000003.rsp" with contents
[
/OUT:"Debug/TestDialogue.exe" /INCREMENTAL /NOLOGO /DEBUG /PDB:"Debug/
TestDialogue.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86
".\debug\TestDialogue.obj"
".\debug\TestDialogueDlg.obj"
".\debug\stdafx.obj"
]
Creating command line "link.exe @"d:\Profiles\shbridges.REST\My
Documents\cutlass\TestDialogue\Debug\RSP000003.rsp""

The debug log for said project:

'TestDialogue.exe': Loaded 'D:\Profiles\shbridges.REST\My
Documents\cutlass\TestDialogue\Debug\TestDialogue.exe', Symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\ntdll.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\kernel32.dll', No
symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\mfc71d.dll', Symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\msvcr71d.dll', Symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\gdi32.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\user32.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\shlwapi.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\advapi32.dll', No
symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\comctl32.dll', No
symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\oleaut32.dll', No
symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\ole32.dll', No symbols
loaded.
'TestDialogue.exe': Loaded 'C:\WINNT\system32\MFC71ENU.DLL', No
symbols
loaded.
Warning: Destroying non-NULL m_pMainWnd
First-chance exception at 0x7c235aac (mfc71d.dll) in TestDialogue.exe:
0xC0000005: Access violation reading location 0x00000068.
Unhandled exception at 0x7c235aac (mfc71d.dll) in TestDialogue.exe:
0xC0000005: Access violation reading location 0x00000068.

This error only occurs in debug, in release the GUI fails to start and
exits without crashing.

Stephen.

.



Relevant Pages

  • Re: Visual Studio 2003 MFC wizard code fails to run
    ... I've never seen VS fail to create resources for a dialog-based app. ... managed to fail to create the resource segment. ... Creating temporary file "d:\Profiles\shbridges.REST\My Documents ...
    (microsoft.public.vc.mfc)
  • Re: Visual Studio 2003 MFC wizard code fails to run
    ... Did you look at your Resource View? ... The phrase "specified image file" implies to me that an image file is ...
    (microsoft.public.vc.mfc)
  • Re: Question on using /tmp
    ... >temporary file and my code is going to read something out of it. ... Only when I call the command in the form ... But I have to use tmpnam since ... It depends on what kind of security you are trying to implement, ...
    (comp.os.linux.development.apps)
  • Re: unresolved external error
    ... Command Lines Creating temporary file ... Build Log Rebuild started: Project: SimAPI, Configuration: Release|Win32 ...
    (microsoft.public.vc.mfc)
  • Re: unresolved external error
    ... Command Lines Creating temporary file ... Build Log Rebuild started: Project: SimAPI, Configuration: Release|Win32 ...
    (microsoft.public.vc.mfc)