|
Hi,
I want to do FTP client application in vc 6.0/MFC which should include the following functions,
1.Connect to the ftp server..(here i use local host)
1.List the directories in tree view and Navigation between directories.
2.Enumerating, creating, removing, and renaming directories.
3.Renaming, uploading, downloading, and deleting files.
i don know how to start from the scratch. I use the local host and user as anonymous. can anyone guide me how to connect to the ftp local host/server. I hav confusion between winsocket and wininet.. which one i should use for ftp client application and tell me how to proceed further?
|
|
|
|
|
see the link
http://www.codeproject.com/KB/IP/ftpserver.aspx
|
|
|
|
|
Thanks for the reply..The Link which you hav sent deal with FTP Server.. I need FTP Client Application...
|
|
|
|
|
Ok, then this link will help
http://msdn.microsoft.com/en-us/library/hf9x9wb4.aspx
if you still any problem to develop, we can find any already developed source and understand it ?
|
|
|
|
|
|
Hi,
Actually i am getting several url 's from the server and i want to the url in my window application(Using MFC) in a CListCtrl.
But it is giving runtime error in InsertItem() ans SetItemText() function although complied with 0 erroes.
Can anyone tell me what is the problem.
My code is as follows:
void CMainDlg::UpdateFootPrintsForVisitor(int n, CString strResponseFootPrints)
{
if(n>-1)
{
if(strResponseFootPrints.IsEmpty())
return;
CStringArray* ptrstrArray = CParser::Parse(strResponseFootPrints,g_strDelimFLD);
for(int i=0; i<ptrstrarray->GetSize(); i++)
{
LVITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.iItem = i;
lvItem.iSubItem = 0;
lvItem.pszText = _T("Sandra C. Anschwitz");
int nItem=m_lstGetFootPrints.InsertItem(&lvItem);//error line during run
m_lstGetFootPrints.SetItemText(nItem,0,(LPCTSTR)(ptrstrArray->GetAt(i)));
}
}
Thanks in Advance
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: lvItem.pszText = _T("Sandra C. Anschwitz");
This could be issue (just guessing), try this...
TCHAR szName[] = _T("Sandra C. Anschwitz");
lvItem.pszText = szName;
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Just fill the ivItem with 0 to ensure that all other fields are not holding any garbage values.
for(int i=0; iGetSize(); i++)<br />
{<br />
LVITEM lvItem;<br />
ZeroMemory(&lvItem, sizeof(LVITEM));<br />
lvItem.mask = LVIF_TEXT;<br />
lvItem.iItem = i;<br />
lvItem.iSubItem = 0;<br />
lvItem.pszText = _T("Sandra C. Anschwitz");<br />
<br />
int nItem=m_lstGetFootPrints.InsertItem(&lvItem);
m_lstGetFootPrints.SetItemText(nItem,0,(LPCTSTR)(ptrstrArray->GetAt(i)));<br />
}
cheers
Varghese Paul
|
|
|
|
|
Hi,
Still its giving error in the InsertItem() and SetItemText() function.
Please Tell me what to do.
Thanks
Dhiraj Kumar Saini
|
|
|
|
|
Dhiraj kumar Saini wrote: Still its giving error in the InsertItem() and SetItemText() function.
Please Tell me what to do.
MSDN on iSubItem...
iSubItem
One-based index of the subitem to which this structure refers, or zero if this structure refers to an item rather than a subitem.
You are giving zero based, that should be the problem if it's a report style list.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Hi,
Actually i want ClistControl with only one column to show one data data. It does not contain anyother sub item. So iSubItem is given value zero and not one.
Dont know what to do.
Thanks
Dhiraj Kumar Saini
|
|
|
|
|
From where you are calling method UpdateFootPrintsForVisitor from your code?
Is the m_lstGetFootPrints object is valid at that time?
Just try ::IsWindow(m_lstGetFootPrints.m_hWnd) to make sure that the control is created and ready to work.
cheers
Varghese Paul
|
|
|
|
|
U r gr8
It worked ::IsWindow(m_lstGetFootPrints.m_hWnd)
Thanks a lot.
u r genius
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: But it is giving runtime error...
Are we supposed to guess what this is?
"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
|
|
|
|
|
Hi,
I am developing a dialog application. In my dialog i have a tabcontrol which is having two tab pages. I have shortcut like Alt+x for my dialog. If the focus is in propertypage these shortcuts are not working. What should i do to enable those?
|
|
|
|
|
|
GetMessage and PeekMessage are used to get a message from message queue while PostMessage is used to post a message.
The major difference between GetMessage and PeekMessage is that GetMessage doesn't return until it finds a message to retrieve from the
Message Queue and PeekMessage() returns immediately weather there are any messages or not.
While PostMessage is used to post a message to window and it returns immediately without waiting for the response.
Manish Agarwal
manish.k.agarwal @ gmail DOT com
|
|
|
|
|
SendMessage
Which the same as PostMessage except it blocks until the message has been processed by the window.
|
|
|
|
|
Do you feel the documentation about [^] not satisfactory?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am trying to launch a dialog in modal-less mode but am getting error:
Bool CDialog::Create cannot convert from int to LPCTSTR but the tutorials says to do it this way. Any help appreciated. Here my prog:
THIS IS A MFC DLL
MAIN APP:-
// Ai.cpp : Defines the initialization routines for the DLL.
#include "stdafx.h"
#include "Ai.h"
#include "ProgressDialog.h"
BOOL CAiApp::InitInstance() {
CProgressDialog* MLDlg= new CProgressDialog;
MLDlg->Create(IDD_TRACEINFO, this);
MLDlg->ShowWindow(SW_SHOW);
return true;
}
---------------------------------------------------------------------
ProgressDialog header:-
#pragma once
// CProgressDialog dialog
class CProgressDialog : public CDialog {
DECLARE_DYNAMIC(CProgressDialog)
public:
CProgressDialog(CWnd* pParent = NULL); // standard constructor
virtual ~CProgressDialog();
// Dialog Data
enum { IDD = IDD_TRACEINFO };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk();
}; // END CLASS
---------------------------------------------------------------------
// ProgressDialog.cpp : implementation file
//
#include "stdafx.h"
#include "Ai.h"
#include "ProgressDialog.h"
// CProgress dialog
IMPLEMENT_DYNAMIC(CProgressDialog, CDialog)
CProgressDialog::CProgressDialog(CWnd* pParent /*=NULL*/)
: CDialog(CProgressDialog::IDD, pParent) {
}
CProgressDialog::~CProgressDialog(){
}
void CProgressDialog::DoDataExchange(CDataExchange* pDX){
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CProgressDialog, CDialog)
ON_BN_CLICKED(IDOK, &CProgressDialog::OnBnClickedOk)
END_MESSAGE_MAP()
// CProgressDialog message handlers
void CProgressDialog::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
OnOK();
}
---------------------------------------------------------------------
RESOURCE FILE :-
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Ai.rc
//
#define IDP_SOCKETS_INIT_FAILED 101
#define IDD_CONFIGURE_DIALOG 1000
#define IDC_TXMESSAGE 1000
#define IDD_TRACEINFO 1001
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1002
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 1000
#endif
#endif
thanks
|
|
|
|
|
limesp wrote: Bool CDialog::Create cannot convert from int to LPCTSTR
Most probably you should pass the id of the dialog by using MAKEINTRESOURCE(DialogId) , this will do the trick.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
But what happed to the BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL); function?
|
|
|
|
|
Naveen wrote: BOOL Create(UINT nIDTemplate, CWnd* pParentWnd = NULL);
Yeah, me too thought about it, I can still see it in the headers though. Pretty strange that he got that error.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Found out the problem.
the other create overload is the one that i wanted
create(dialog number, handle)
because i am using 'this' for the handle but a dll does not have a "Form" handle so it defaulted to the overload that gave me that problem
create(template, handle)
so I use the default null for the handler.
It worked. 
|
|
|
|
|
Hello everyone,
When using mapvariable[somekey] = somevalue to insert into a map variable, how to check whether there is conflicting key value in the map in an elegant way?
thanks in advance,
George
|
|
|
|