Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDesktop Changed Information Pin
ashishbhatt9-Oct-07 21:50
ashishbhatt9-Oct-07 21:50 
AnswerRe: Desktop Changed Information Pin
David Crow11-Oct-07 2:56
David Crow11-Oct-07 2:56 
QuestionWhy the type conversion is needed? Pin
LiYS9-Oct-07 21:37
LiYS9-Oct-07 21:37 
AnswerRe: Why the type conversion is needed? Pin
Cedric Moonen9-Oct-07 21:44
Cedric Moonen9-Oct-07 21:44 
GeneralRe: Why the type conversion is needed? Pin
LiYS9-Oct-07 22:06
LiYS9-Oct-07 22:06 
AnswerRe: Why the type conversion is needed? Pin
Naveen9-Oct-07 21:48
Naveen9-Oct-07 21:48 
GeneralRe: Why the type conversion is needed? Pin
LiYS9-Oct-07 22:06
LiYS9-Oct-07 22:06 
QuestionInternetFindNextFile function falis Pin
onlyjaypatel9-Oct-07 19:50
onlyjaypatel9-Oct-07 19:50 
I want all the filenames in perticular folder of web server
with http call.

InternetFindNextFile function falis


some sample of code.
.
.

CString sUserAgentName = "Microsoft Internet Explorer";

DWORD dwAccessType = INTERNET_OPEN_TYPE_PRECONFIG ;

DWORD dwFlags =INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_RELOAD ;

//pInternetSession = new CInternetSession(sUserAgentName,dwContext,dwAccessType,NULL,NULL,dwFlags);


CString sUrl="http://www.test.com/1";
WIN32_FIND_DATA wfd;
HINTERNET hInternetFind,hInternetOpen = InternetOpen(sUserAgentName,dwAccessType,NULL,NULL,0);
CStringArray saFileName, saDirectoryName;
CString sName;


CString sServerName , sServerObjectName ;

DWORD dwServiceType = 0 ;

INTERNET_PORT nServerPort = 0;

CString strHeaders ;

CString sUserName = "";

CString sPassword ;

DWORD dwContext = 0;

if(AfxParseURL(sUrl,dwServiceType,sServerName,sServerObjectName,nServerPort)==FALSE)
{
AfxMessageBox("AfxParseURL() Fails");
return false;
}
int err;

//pConnection = pInternetSession->GetHttpConnection(sServerName,nServerPort,sUserName,sPassword);

//HINTERNET hInternetConnect =

::InternetConnect(hInternetOpen,sServerName,nServerPort,sUserName,sPassword,INTERNET_SERVICE_HTTP,dwFlags,dwContext);

//err = GetLastError();

//hInternetFind = FtpFindFirstFile(hInternetConnect,"*.*",&wfd,0,0);
/*if i try function FtpFindFirstFile than it returns null and errorcode is

ERROR_INTERNET_INCORRECT_HANDLE_TYPE(12018)
*/

//err = GetLastError();

hInternetFind = InternetOpenUrl(hInternetOpen,sUrl,NULL,0,INTERNET_FLAG_RAW_DATA| INTERNET_FLAG_RELOAD|
INTERNET_FLAG_DONT_CACHE,0);
/* if i try InternetOpenUrl than it retrn not null but when InternetFindNextFile is called than it returns FALSE
ERROR_INTERNET_INVALID_OPERATION(12016)*/


err = GetLastError();

if (hInternetFind ==NULL)
{
AfxMessageBox("(hInternetFind == NULL)");
}

if (InternetFindNextFile(hInternetFind, &wfd) == FALSE)
{
err = GetLastError();
AfxMessageBox("(InternetFindNextFile = fails)");
}
do
{
if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
sName = (const char*) &wfd.cFileName;
if(!sName.IsEmpty())
{
if (sName.GetAt(0) == '.')
continue;
saDirectoryName.Add(sName);
}

}
else
saFileName.Add(sName);

}
while (InternetFindNextFile (hInternetFind, &wfd));
InternetCloseHandle(hInternetFind);
.
.
.



Rose | [Rose] thanx
QuestionRe: InternetFindNextFile function falis Pin
David Crow10-Oct-07 2:57
David Crow10-Oct-07 2:57 
AnswerRe: InternetFindNextFile function falis Pin
onlyjaypatel10-Oct-07 19:11
onlyjaypatel10-Oct-07 19:11 
GeneralRe: InternetFindNextFile function falis Pin
David Crow11-Oct-07 2:52
David Crow11-Oct-07 2:52 
GeneralRe: InternetFindNextFile function falis Pin
onlyjaypatel16-Oct-07 20:53
onlyjaypatel16-Oct-07 20:53 
QuestionWhere is the first data location in Monochrome BMP image? Pin
Mohammad Khodaea9-Oct-07 19:24
Mohammad Khodaea9-Oct-07 19:24 
AnswerRe: Where is the first data location in Monochrome BMP image? Pin
Nishad S9-Oct-07 19:48
Nishad S9-Oct-07 19:48 
AnswerRe: Where is the first data location in Monochrome BMP image? Pin
Mark Salsbery10-Oct-07 6:19
Mark Salsbery10-Oct-07 6:19 
QuestionRead stream of bytes in a buffer as a String [modified] Pin
CodingLover9-Oct-07 18:40
CodingLover9-Oct-07 18:40 
AnswerRe: Read stream of bytes in a buffer as a String Pin
chandu0049-Oct-07 18:57
chandu0049-Oct-07 18:57 
GeneralRe: Read stream of bytes in a buffer as a String [modified] Pin
CodingLover9-Oct-07 19:05
CodingLover9-Oct-07 19:05 
GeneralRe: Read stream of bytes in a buffer as a String Pin
chandu0049-Oct-07 19:17
chandu0049-Oct-07 19:17 
GeneralRe: Read stream of bytes in a buffer as a String Pin
CodingLover9-Oct-07 19:28
CodingLover9-Oct-07 19:28 
GeneralRe: Read stream of bytes in a buffer as a String Pin
ktm TechMan9-Oct-07 20:56
ktm TechMan9-Oct-07 20:56 
GeneralRe: Read stream of bytes in a buffer as a String Pin
CodingLover9-Oct-07 21:05
CodingLover9-Oct-07 21:05 
GeneralRe: Read stream of bytes in a buffer as a String Pin
chandu00410-Oct-07 0:22
chandu00410-Oct-07 0:22 
QuestionRe: Read stream of bytes in a buffer as a String Pin
David Crow10-Oct-07 2:56
David Crow10-Oct-07 2:56 
AnswerRe: Read stream of bytes in a buffer as a String Pin
CodingLover10-Oct-07 19:16
CodingLover10-Oct-07 19:16 

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.