Click here to Skip to main content
16,021,041 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 4:03
Chuck O'Toole6-Sep-11 4:03 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu6-Sep-11 8:46
_Flaviu6-Sep-11 8:46 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 10:16
Chuck O'Toole6-Sep-11 10:16 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole6-Sep-11 10:25
Chuck O'Toole6-Sep-11 10:25 
GeneralRe: ShowNotifyBaloon problem Pin
MicroVirus6-Sep-11 15:45
MicroVirus6-Sep-11 15:45 
GeneralRe: ShowNotifyBaloon problem Pin
_Flaviu7-Sep-11 7:15
_Flaviu7-Sep-11 7:15 
GeneralRe: ShowNotifyBaloon problem Pin
Chuck O'Toole7-Sep-11 13:05
Chuck O'Toole7-Sep-11 13:05 
Question"The system cannot find the file specified" Pin
AndrewG12312-Sep-11 12:07
AndrewG12312-Sep-11 12:07 
I am trying to debug a program that is having a strange issue. When I first build and run the program it saves an image file, but after a series of saves the program will suddenly have a windows exception thrown. The error is happening at this point in the code:

void CDlg_ScanAcq::OnPlaceData() 
//lots of data writing that works

CString title;
title.Format("%06d.stm",theInst->m_Flags.ScanNumber);
strcat(pDoc->m_Header.FileName, title); 
pDoc->SetTitle(title);
pDoc->m_Ready = true;
pDoc->SetModifiedFlag(true);
pDoc->ShowAllViews();
	
CWinSTMApp *theApp = (CWinSTMApp*)AfxGetApp();

CString path;

path = theApp->m_Default.SaveDir + title;

//The problems seems to start here, but the path name looks fine in the value field
pDoc->SetPathName(path);


This leads me to the exception being thrown here
void CRecentFileList::Add(LPCTSTR lpszPathName, LPCTSTR lpszAppID)
{
	if (!afxGlobalData.bIsWindows7)
	{
		Add(lpszPathName);
		return;
	}

	CString strAppID = lpszAppID == NULL ? _T("") : lpszAppID;

#if (WINVER >= 0x0601)
	ASSERT(AfxIsValidString(lpszPathName));

	Add(lpszPathName);

//this is passed no problem
	HRESULT hr = S_OK;
	CComPtr<IShellItem> psi = NULL;

#ifdef UNICODE
	hr = afxGlobalData.ShellCreateItemFromParsingName(lpszPathName, NULL, IID_IShellItem, reinterpret_cast<void**>(&psi));
#else
	{
//something goes wrong here
		USES_CONVERSION;
		LPOLESTR lpWPath = A2W(lpszPathName);
		hr = afxGlobalData.ShellCreateItemFromParsingName(lpWPath, NULL, IID_IShellItem, (LPVOID*)&psi);
	}
#endif

//The value of hr is 0x80070002 and says "The system cannot find the file specified"
	ENSURE(SUCCEEDED(hr));


If I manually save the data, which is an image, then everything is fine...but this very inconvenient and I would like to find the reason the bug suddenly pops up. I can try to provide more information if anyone has an idea as to why this is happening. Thanks!
AnswerRe: "The system cannot find the file specified" Pin
Cheongwadae2-Sep-11 17:34
Cheongwadae2-Sep-11 17:34 
QuestionIntroducing tests into a legacy application? Pin
Stefan_Lang1-Sep-11 22:18
Stefan_Lang1-Sep-11 22:18 
AnswerRe: Introducing tests into a legacy application? Pin
Orjan Westin1-Sep-11 23:10
professionalOrjan Westin1-Sep-11 23:10 
GeneralRe: Introducing tests into a legacy application? Pin
Stefan_Lang1-Sep-11 23:59
Stefan_Lang1-Sep-11 23:59 
GeneralRe: Introducing tests into a legacy application? Pin
Orjan Westin2-Sep-11 3:30
professionalOrjan Westin2-Sep-11 3:30 
GeneralRe: Introducing tests into a legacy application? Pin
Stefan_Lang2-Sep-11 4:01
Stefan_Lang2-Sep-11 4:01 
GeneralRe: Introducing tests into a legacy application? Pin
Orjan Westin2-Sep-11 3:45
professionalOrjan Westin2-Sep-11 3:45 
QuestionText drawing is not getting properly Pin
Amrit Agr31-Aug-11 3:15
Amrit Agr31-Aug-11 3:15 
AnswerRe: Text drawing is not getting properly Pin
Alan Balkany31-Aug-11 4:10
Alan Balkany31-Aug-11 4:10 
AnswerRe: Text drawing is not getting properly Pin
xrg_soft@163.com31-Aug-11 6:16
xrg_soft@163.com31-Aug-11 6:16 
GeneralRe: Text drawing is not getting properly Pin
Amrit Agr1-Sep-11 22:50
Amrit Agr1-Sep-11 22:50 
GeneralRe: Text drawing is not getting properly Pin
xrg_soft@163.com5-Sep-11 18:13
xrg_soft@163.com5-Sep-11 18:13 
Questionconvert a C app to an MFC based Windows app Pin
Angela201231-Aug-11 3:00
Angela201231-Aug-11 3:00 
QuestionHow to learn C++ Pin
shanmugarajaa30-Aug-11 18:16
shanmugarajaa30-Aug-11 18:16 
QuestionRe: How to learn C++ Pin
David Crow31-Aug-11 2:41
David Crow31-Aug-11 2:41 
AnswerRe: How to learn C++ Pin
Chris Losinger31-Aug-11 3:02
professionalChris Losinger31-Aug-11 3:02 
GeneralRe: How to learn C++ Pin
Albert Holguin31-Aug-11 8:22
professionalAlbert Holguin31-Aug-11 8:22 

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.