![]() |
|
#1
|
|||
|
|||
File Serialize's problemHi,
I am a newbie of MFC programming. I practice an example of the book, and I typed same code of the book that the author wrote. It's ok when I compile and build, but run it for file operation will occur error. error message as follow: ------------------------------------- Debug Assertion Failed! program:c:\Documents and Settings\554\桌面\MFC\Painter\Debug\Painter.exe File: docmgr.cpp Line: 577 ------------------------------------- docmgr.cpp isn't mine, I think MFC provide it. I tried set breakpoint in the Line 577 in docmgr.cpp, and debug. VERIFY(title.LoadString(nIDSTitle)); // => Line 577 CString::LoadString() error cause VERIFY's error. I trace the code to find someone call the function there.In the debug mode, callback window order as follow CDocManager CDocManager::OnFileOpen() line 836 + 31 bytes CWinApp::OnFileOpen() line 37 So, it's problem of nIDSTitle. Trace again, if (!DoPromptFileName(newName, AFX_IDS_OPENFILE, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, true, null)) return; // open cancelled Anyone can help me to solve this problem. Thanks..... |
|||
|
#2
|
|||
|
|||
|
title.LoadString(nIDSTitle) failed trying to load a resource. The bug is not likely to be in the MFC lib, but somewhere in your code. MFC is loaded with tons of ASSERT's and VERIFY's and when one of them triggers it's most likely due to an error by the programmer that it wants to alert you of.
Whatever function is being called, is it supplied with a valid resource ID? (Presumably a string ID) or just giving a random integer as input? Look at the callstack and find where in your code the function triggering the assert is called. Alternatively you could step through your program until it asserts. |
|
#3
|
|||
|
|||
|
Why?
I traced the bug about serialize(file operation), but don't obtain at all. So I change the project settings from visual c++6, change MFC setting from "Use MFC in a static library" to "Use MFC in a shared DLL". Then compile and build it, it can work without any problem happen! It's funny, I don't know how to explain it. Anyone can teach me what happened? Thanks..... |
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CD Burner Help - Power Calibration Error.... | JonBoy420 | Computer Hardware Forum | 111 | 19-Feb-2009 04:54 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| Re: Programming Techniques | WaltP | C Programming Language | 0 | 10-Mar-2004 00:56 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The