Click here to Skip to main content
15,893,668 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can I upload an file in MFC ? Pin
mesajflaviu26-Jan-11 23:40
mesajflaviu26-Jan-11 23:40 
AnswerRe: How can I upload an file in MFC ? Pin
David Crow27-Jan-11 4:16
David Crow27-Jan-11 4:16 
GeneralRe: How can I upload an file in MFC ? Pin
mesajflaviu27-Jan-11 8:54
mesajflaviu27-Jan-11 8:54 
QuestionRe: How can I upload an file in MFC ? Pin
David Crow27-Jan-11 8:57
David Crow27-Jan-11 8:57 
AnswerRe: How can I upload an file in MFC ? Pin
mesajflaviu27-Jan-11 8:59
mesajflaviu27-Jan-11 8:59 
GeneralRe: How can I upload an file in MFC ? Pin
David Crow27-Jan-11 9:14
David Crow27-Jan-11 9:14 
GeneralRe: How can I upload an file in MFC ? Pin
mesajflaviu27-Jan-11 10:19
mesajflaviu27-Jan-11 10:19 
GeneralRe: How can I upload an file in MFC ? Pin
mesajflaviu30-Jan-11 19:55
mesajflaviu30-Jan-11 19:55 
I found the solution , and for those hwo have the same issue , I post the code :
BOOL CMyDoc::UploadFile(CString sFileName)
{
	CString sTemp;
	BOOL bRet = FALSE;
	CInternetSession session;
	CFtpConnection* pConn = NULL;
	CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
	sTemp = sFileName.Right(sFileName.GetLength() - sFileName.ReverseFind('\\') - 1);

	try
	{
		pConn = session.GetFtpConnection(_T("ftp.domain.com"),_T("username"),_T("password"),INTERNET_INVALID_PORT_NUMBER,TRUE);
		bRet = pConn->PutFile(sFileName,_T("./httpdocs/temp/") + sTemp);
	}
	catch(CException* pException)
	{
		pException->GetErrorMessage(sTemp.GetBuffer(255),255);
		sTemp.ReleaseBuffer();
		pException->Delete();
		pFrame->SetMessageText(sTemp);
	}

	if(pConn)
	{
		pConn->Close();
		delete pConn;
	}

	return bRet;
}

QuestionCan anybody help me to convert some vb function in vc++? [modified] Pin
Le@rner26-Jan-11 23:12
Le@rner26-Jan-11 23:12 
GeneralRe: Can anybody help me to convert some vb function in vc++? Pin
Malli_S26-Jan-11 23:21
Malli_S26-Jan-11 23:21 
AnswerRe: Can anybody help me to convert some vb function in vc++? Pin
CPallini26-Jan-11 23:38
mveCPallini26-Jan-11 23:38 
Questionhow to use CButton class in win 32 Pin
rajniyadav1a26-Jan-11 19:41
rajniyadav1a26-Jan-11 19:41 
AnswerRe: how to use CButton class in win 32 Pin
_AnsHUMAN_ 26-Jan-11 20:19
_AnsHUMAN_ 26-Jan-11 20:19 
AnswerRe: how to use CButton class in win 32 Pin
Cedric Moonen26-Jan-11 20:31
Cedric Moonen26-Jan-11 20:31 
AnswerRe: how to use CButton class in win 32 Pin
CPallini26-Jan-11 21:30
mveCPallini26-Jan-11 21:30 
Questionhow to close document handle Pin
VCsamir26-Jan-11 18:19
VCsamir26-Jan-11 18:19 
AnswerRe: how to close document handle Pin
Cedric Moonen26-Jan-11 20:38
Cedric Moonen26-Jan-11 20:38 
AnswerRe: how to close document handle Pin
CPallini26-Jan-11 22:02
mveCPallini26-Jan-11 22:02 
GeneralRe: how to close document handle Pin
VCsamir26-Jan-11 22:21
VCsamir26-Jan-11 22:21 
GeneralRe: how to close document handle Pin
Richard MacCutchan26-Jan-11 22:38
mveRichard MacCutchan26-Jan-11 22:38 
Questionelse does nto return expected value Pin
jharn26-Jan-11 9:34
jharn26-Jan-11 9:34 
AnswerRe: else does nto return expected value Pin
TheGreatAndPowerfulOz26-Jan-11 9:47
TheGreatAndPowerfulOz26-Jan-11 9:47 
GeneralRe: else does not return expected value Pin
jharn26-Jan-11 10:04
jharn26-Jan-11 10:04 
GeneralRe: else does not return expected value Pin
TheGreatAndPowerfulOz26-Jan-11 10:08
TheGreatAndPowerfulOz26-Jan-11 10:08 
GeneralRe: else does not return expected value Pin
jharn26-Jan-11 10:10
jharn26-Jan-11 10:10 

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.