CDocManager::DoPromptFileName(...) error
-
I used Visual C++ 2005 to generate an MFC doc-view sample application. I got an strange error message when I try to open an previously save file in MFC in a static library. I have traced the problem and it was the codes in MFC provided docmgr.cpp below which caused the problem: BOOL CDocManager::DoPromptFileName(CString& fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate) { CFileDialog dlgFile(bOpenFileDialog, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, NULL, 0); CString title; VERIFY(title.LoadString(nIDSTitle)); dlgFile.m_ofn.Flags |= lFlags; ... } The VERIFY(title.LoadString(nIDSTitle)) statement gives VERIFY's error. However, if I compiled the application in "Use MFC in a shared DLL". Then compile and build it, it can work without any problem! Anyone know what the problem is?
-
I used Visual C++ 2005 to generate an MFC doc-view sample application. I got an strange error message when I try to open an previously save file in MFC in a static library. I have traced the problem and it was the codes in MFC provided docmgr.cpp below which caused the problem: BOOL CDocManager::DoPromptFileName(CString& fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate) { CFileDialog dlgFile(bOpenFileDialog, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, NULL, 0); CString title; VERIFY(title.LoadString(nIDSTitle)); dlgFile.m_ofn.Flags |= lFlags; ... } The VERIFY(title.LoadString(nIDSTitle)) statement gives VERIFY's error. However, if I compiled the application in "Use MFC in a shared DLL". Then compile and build it, it can work without any problem! Anyone know what the problem is?
-
I used Visual C++ 2005 to generate an MFC doc-view sample application. I got an strange error message when I try to open an previously save file in MFC in a static library. I have traced the problem and it was the codes in MFC provided docmgr.cpp below which caused the problem: BOOL CDocManager::DoPromptFileName(CString& fileName, UINT nIDSTitle, DWORD lFlags, BOOL bOpenFileDialog, CDocTemplate* pTemplate) { CFileDialog dlgFile(bOpenFileDialog, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, NULL, NULL, 0); CString title; VERIFY(title.LoadString(nIDSTitle)); dlgFile.m_ofn.Flags |= lFlags; ... } The VERIFY(title.LoadString(nIDSTitle)) statement gives VERIFY's error. However, if I compiled the application in "Use MFC in a shared DLL". Then compile and build it, it can work without any problem! Anyone know what the problem is?
yellowine wrote:
Anyone know what the problem is?
Have you set a breakpoint on that statement to see what the value of
nIDSTitle
is, or how about stepping into theLoadString()
method to see what it is returning?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
looks like the string id isnt representing a string in your resource. Make a "Rebuild all" and look whether the id is a valid string.
Greetings from Germany
-
yellowine wrote:
Anyone know what the problem is?
Have you set a breakpoint on that statement to see what the value of
nIDSTitle
is, or how about stepping into theLoadString()
method to see what it is returning?"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
Tried step into debug, nIDSTitle seems to be the standard AFX_IDS_OPENFILE (61440). It seems the standard AFX_IDA_... are defined in afxres.rc, how how comes this file is not included in the project. Therefore it seems to be related to project setting to solve it. Just dunno. Any idea?
-
Tried step into debug, nIDSTitle seems to be the standard AFX_IDS_OPENFILE (61440). It seems the standard AFX_IDA_... are defined in afxres.rc, how how comes this file is not included in the project. Therefore it seems to be related to project setting to solve it. Just dunno. Any idea?