Click here to Skip to main content
16,004,974 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: In VC++6 : Pin
A_Fa25-Sep-06 19:20
A_Fa25-Sep-06 19:20 
GeneralRe: In VC++6 : Pin
A_Fa25-Sep-06 19:23
A_Fa25-Sep-06 19:23 
AnswerRe: Dialog Box , replace "Ok"string to an Icon Pin
Hamid_RT26-Sep-06 3:58
Hamid_RT26-Sep-06 3:58 
QuestionConnect with FTP Pin
Larsson25-Sep-06 11:25
Larsson25-Sep-06 11:25 
AnswerRe: Connect with FTP Pin
markkuk25-Sep-06 11:37
markkuk25-Sep-06 11:37 
AnswerRe: Connect with FTP Pin
Hamid_RT26-Sep-06 3:47
Hamid_RT26-Sep-06 3:47 
QuestionService accessing mapped network drives Pin
Daniel 'Tak' M.25-Sep-06 11:12
Daniel 'Tak' M.25-Sep-06 11:12 
Questionproblem with FormatMessage Pin
Mohammad A Gdeisat25-Sep-06 8:04
Mohammad A Gdeisat25-Sep-06 8:04 
Hi,

I try to rename a file using MoveFile() API function and I want to generate an error message if the function fails, I use FormatMessage() along with GetLastError() to format an error message, but after testing the code, when I attemp to rename to an invalid filename that includes invalid characters like (? / *) I get the error message: 'there is not enough disk space on the disk' and it doesnt seem to be informative... here is the code:
<br />
int iRes=MoveFile(m_strCurrentPath + strFilename,m_strCurrentPath +strNewFilename);<br />
	if(iRes!=0)	//Rename was successful<br />
	{<br />
		m_lstFiles.GetListCtrl().SetItem(iItem,0,LVIF_TEXT,strNewFilename,0,0,0,0);<br />
		return TRUE;<br />
	}<br />
	else<br />
	{<br />
		LPVOID strError;<br />
		if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM ,0,GetLastError(),0,(LPTSTR)&strError,0,0)!=0)<br />
		{<br />
			MessageBox((LPCTSTR)strError,0,MB_ICONERROR);<br />
			LocalFree((HLOCAL)strError);<br />
		}<br />
		else<br />
		{<br />
			MessageBox(_T("An Unknown Error has occured!"),0,MB_ICONERROR);<br />
		}<br />
	}<br />
	return FALSE;


And ever has it been that love knows not its own depth until the hour of separation

QuestionRe: problem with FormatMessage Pin
David Crow25-Sep-06 8:17
David Crow25-Sep-06 8:17 
AnswerRe: problem with FormatMessage Pin
Mohammad A Gdeisat25-Sep-06 9:41
Mohammad A Gdeisat25-Sep-06 9:41 
GeneralRe: problem with FormatMessage Pin
David Crow25-Sep-06 9:44
David Crow25-Sep-06 9:44 
Questionmake jar file Pin
cqwangdonghua25-Sep-06 7:26
cqwangdonghua25-Sep-06 7:26 
AnswerRe: make jar file Pin
Anonymuos25-Sep-06 7:59
Anonymuos25-Sep-06 7:59 
GeneralRe: make jar file Pin
cqwangdonghua25-Sep-06 15:07
cqwangdonghua25-Sep-06 15:07 
GeneralRe: make jar file Pin
kakan25-Sep-06 19:53
professionalkakan25-Sep-06 19:53 
GeneralRe: make jar file Pin
S Douglas25-Sep-06 23:09
professionalS Douglas25-Sep-06 23:09 
QuestionProblem with static in c programming Pin
EzraYap25-Sep-06 6:13
EzraYap25-Sep-06 6:13 
QuestionRe: Problem with static in c programming Pin
jhwurmbach25-Sep-06 6:22
jhwurmbach25-Sep-06 6:22 
AnswerRe: Problem with static in c programming Pin
EzraYap25-Sep-06 6:46
EzraYap25-Sep-06 6:46 
AnswerRe: Problem with static in c programming Pin
toxcct25-Sep-06 6:48
toxcct25-Sep-06 6:48 
AnswerRe: Problem with static in c programming Pin
Zac Howland25-Sep-06 8:18
Zac Howland25-Sep-06 8:18 
QuestionCommand-line code merged with GUI Pin
mikhailxyohman25-Sep-06 5:19
mikhailxyohman25-Sep-06 5:19 
AnswerRe: Command-line code merged with GUI Pin
toxcct25-Sep-06 5:30
toxcct25-Sep-06 5:30 
GeneralRe: Command-line code merged with GUI Pin
mikhailxyohman25-Sep-06 5:40
mikhailxyohman25-Sep-06 5:40 
GeneralRe: Command-line code merged with GUI Pin
toxcct25-Sep-06 6:49
toxcct25-Sep-06 6:49 

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.