Click here to Skip to main content
15,919,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to retrieve dll function parameter variables? Pin
ThinkingPrometheus17-Jan-06 21:40
ThinkingPrometheus17-Jan-06 21:40 
GeneralRe: how to retrieve dll function parameter variables? Pin
Stephen Hewitt18-Jan-06 1:59
Stephen Hewitt18-Jan-06 1:59 
AnswerRe: how to retrieve dll function parameter variables? Pin
vallikumar17-Jan-06 19:10
vallikumar17-Jan-06 19:10 
GeneralRe: how to retrieve dll function parameter variables? Pin
ThinkingPrometheus17-Jan-06 21:47
ThinkingPrometheus17-Jan-06 21:47 
Questiongraph control needed Pin
QuickDeveloper17-Jan-06 0:56
QuickDeveloper17-Jan-06 0:56 
AnswerRe: graph control needed Pin
Sebastian Schneider17-Jan-06 1:11
Sebastian Schneider17-Jan-06 1:11 
AnswerRe: graph control needed Pin
Cedric Moonen17-Jan-06 2:11
Cedric Moonen17-Jan-06 2:11 
GeneralRe: graph control needed Pin
QuickDeveloper17-Jan-06 17:26
QuickDeveloper17-Jan-06 17:26 
GeneralVoting motivation Pin
normanS17-Jan-06 20:42
normanS17-Jan-06 20:42 
GeneralRe: Voting motivation Pin
QuickDeveloper17-Jan-06 21:02
QuickDeveloper17-Jan-06 21:02 
GeneralRe: Voting motivation Pin
S Douglas17-Jan-06 23:43
professionalS Douglas17-Jan-06 23:43 
GeneralRe: Voting motivation Pin
normanS18-Jan-06 0:52
normanS18-Jan-06 0:52 
Questionmoving present MFC project to be part of a new workspace.HOW? Pin
kk_vp16-Jan-06 23:59
kk_vp16-Jan-06 23:59 
AnswerRe: moving present MFC project to be part of a new workspace.HOW? Pin
Owner drawn17-Jan-06 0:04
Owner drawn17-Jan-06 0:04 
AnswerRe: moving present MFC project to be part of a new workspace.HOW? Pin
_AnsHUMAN_ 17-Jan-06 1:56
_AnsHUMAN_ 17-Jan-06 1:56 
AnswerRe: moving present MFC project to be part of a new workspace.HOW? Pin
David Crow17-Jan-06 4:16
David Crow17-Jan-06 4:16 
QuestionProgress bar implementation for recursive directory deletion Pin
Chintoo72316-Jan-06 23:38
Chintoo72316-Jan-06 23:38 
AnswerRe: Progress bar implementation for recursive directory deletion Pin
David Crow17-Jan-06 4:21
David Crow17-Jan-06 4:21 
AnswerRe: Progress bar implementation for recursive directory deletion Pin
vallikumar17-Jan-06 19:27
vallikumar17-Jan-06 19:27 
QuestionIO Completion Ports socket error Pin
yani dzhurov16-Jan-06 22:40
yani dzhurov16-Jan-06 22:40 
AnswerRe: IO Completion Ports socket error Pin
__yb17-Jan-06 11:35
__yb17-Jan-06 11:35 
QuestionFTP directory listing Pin
Angel Kafazov16-Jan-06 21:43
Angel Kafazov16-Jan-06 21:43 
Hi,

I am making an asynchronous ftp connection and then I want to list all files in the current directory. Here is my function

BOOL
StatupController::StartupSyncSoftware( StationType _stType ) {

ClsArchive *UnZipper;
char pszZipFile[64];
char pszDestPath[64];
char pszRemoteFile[64];
char pszFtpServerAddress[64];
HINTERNET hConnection =NULL,
hFtpConnection =NULL,
hDir =NULL;
BOOL bResult;
HINSTANCE hOcx;
FARPROC lpfn;
WIN32_FIND_DATA Data;
BOOL bRes;
DWORD error;

UnZipper = new ClsArchive();

switch( _stType ) {
case SatelliteStation:
strcpy( pszZipFile, "C:\\Flightvision.zip" );
strcpy( pszDestPath, "C:\\" );
strcpy( pszRemoteFile, "Flightvision.zip" );
strcpy( pszFtpServerAddress, "192.168.1.38" );
// open ftp connection
hConnection = InternetOpen( "FVStartup", INTERNET_OPEN_TYPE_DIRECT,
NULL, NULL, INTERNET_FLAG_ASYNC );

InternetSetStatusCallback(hConnection,FtpCallback);
if( hConnection == NULL ) return FALSE;
hFtpConnection = InternetConnect( hConnection, pszFtpServerAddress, INTERNET_DEFAULT_FTP_PORT,
"anonymous", "pass", INTERNET_SERVICE_FTP, 0, 0 );
if(hFtpConnection == NULL) return FALSE;
// find latest version
//DisplayDir(hFtpConnection,INTERNET_FLAG_NEED_FILE);
hDir = FtpFindFirstFile(hFtpConnection, TEXT ("*.*"),
&Data,
INTERNET_FLAG_NEED_FILE,
0);

if(hDir!=NULL) {
do {
bRes = InternetFindNextFile(hDir,&Data);
} while((error=GetLastError())!=ERROR_NO_MORE_FILES); // ERROR_IO_PENDING 997
}

// close connection
InternetCloseHandle(hDir);
InternetCloseHandle(hFtpConnection);
InternetCloseHandle(hConnection);

case BaseStation:
case WorkStation:
case NotAssigned:
default:
return false;
}


the problem is that the InternetFindNextFile(..) function always returns FALSE and the last error that I gen with GetLastError() is ERROR_IO_PENDING. I did not start any lengthy operation before that, this is way it doesn't make much sence to me. I also noticed that the FtpCallback function is never called and, of course, I think this is OK since no operation has been started yet. Can somebody give more insight on this and help me figure out why the directory listing isn't working correctly?

Thank you very much in advance.

A. Kafazov
AnswerRe: FTP directory listing Pin
David Crow17-Jan-06 4:24
David Crow17-Jan-06 4:24 
GeneralRe: FTP directory listing Pin
Angel Kafazov17-Jan-06 4:30
Angel Kafazov17-Jan-06 4:30 
QuestionShare names Pin
kelprinc16-Jan-06 20:39
kelprinc16-Jan-06 20:39 

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.