Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Now it is just clunky Pin
Software_Developer31-May-10 17:38
Software_Developer31-May-10 17:38 
GeneralRe: Now it is just clunky Pin
Luc Pattyn31-May-10 18:27
sitebuilderLuc Pattyn31-May-10 18:27 
AnswerRe: .:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
Aescleal31-May-10 10:29
Aescleal31-May-10 10:29 
QuestionRe: .:: How to convert a gotten int input into a char or string which each of their elements can be accessable separately? [C++] Pin
David Crow1-Jun-10 5:13
David Crow1-Jun-10 5:13 
QuestionBest way to open a HTML file from an URL Pin
Joschwenk66631-May-10 6:34
Joschwenk66631-May-10 6:34 
QuestionRe: Best way to open a HTML file from an URL Pin
David Crow31-May-10 7:13
David Crow31-May-10 7:13 
AnswerRe: Best way to open a HTML file from an URL Pin
Aescleal31-May-10 10:10
Aescleal31-May-10 10:10 
QuestionThe I/O Question of the network file or share file Pin
WanLiJun31-May-10 3:01
WanLiJun31-May-10 3:01 
I encountered a hard question:
#include <windows.h>
#include <time.h>

int main(int argc, char* argv[])
{

LPCTSTR fileName = "\\\\192.169.3.9\\tempdir\\MYFILE.TXT";
HANDLE hFile;
DWORD dwError;
time_t nowTick = time(NULL);
hFile = CreateFile(fileName, // open MYFILE.TXT
GENERIC_READ, // open for reading
FILE_SHARE_READ, // share for reading
NULL, // no security
CREATE_ALWAYS, // overwrite existing
FILE_ATTRIBUTE_NORMAL | // normal file
FILE_FLAG_OVERLAPPED, // asynchronous I/O
NULL); // no attr. template
if (hFile == INVALID_HANDLE_VALUE)
{
dwError = GetLastError();
printf("error:%x, diff:%d\n",dwError, time(NULL) - nowTick);
return 0;
}
CloseHandle(hFile);

return 0;
}

Question:
1.Why does the function CreateFile block a long time when the path specified by the variable fileName is not exist?
2.If i does not expect the function CreateFile block a long time, does it have a better solution?
3.what's the best solution of accessing the file on the net?
I am a c++ programer!
It's cheerful to cooperate with you!

AnswerRe: The I/O Question of the network file or share file Pin
KarstenK31-May-10 3:51
mveKarstenK31-May-10 3:51 
JokeRe: The I/O Question of the network file or share file Pin
Code-o-mat31-May-10 4:24
Code-o-mat31-May-10 4:24 
JokeRe: The I/O Question of the network file or share file Pin
KarstenK31-May-10 4:36
mveKarstenK31-May-10 4:36 
AnswerRe: The I/O Question of the network file or share file Pin
Aescleal31-May-10 9:59
Aescleal31-May-10 9:59 
Questionlibmms and ffmpeg Pin
rastaVnuce31-May-10 2:52
rastaVnuce31-May-10 2:52 
QuestionDLL Pin
john563231-May-10 0:03
john563231-May-10 0:03 
AnswerRe: DLL Pin
Cedric Moonen31-May-10 0:14
Cedric Moonen31-May-10 0:14 
GeneralRe: DLL Pin
john563231-May-10 0:39
john563231-May-10 0:39 
GeneralRe: DLL Pin
ThatsAlok31-May-10 1:47
ThatsAlok31-May-10 1:47 
AnswerRe: DLL Pin
ThatsAlok31-May-10 1:13
ThatsAlok31-May-10 1:13 
GeneralRe: DLL Pin
john563231-May-10 2:29
john563231-May-10 2:29 
AnswerRe: DLL Pin
Aescleal31-May-10 9:49
Aescleal31-May-10 9:49 
Questionencrypt: how to save key to key store Pin
lcryby30-May-10 22:01
lcryby30-May-10 22:01 
QuestionCStaic Problem Pin
john563230-May-10 21:14
john563230-May-10 21:14 
AnswerRe: CStaic Problem Pin
Code-o-mat30-May-10 21:25
Code-o-mat30-May-10 21:25 
AnswerRe: CStaic Problem Pin
ThatsAlok30-May-10 21:27
ThatsAlok30-May-10 21:27 
QuestionGetFont() returning Null [modified] Pin
decoder_8530-May-10 19:26
decoder_8530-May-10 19:26 

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.