Click here to Skip to main content
15,913,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionTranslucent Child Windows Pin
barrem5-Dec-06 13:24
barrem5-Dec-06 13:24 
AnswerRe: Translucent Child Windows Pin
Hamid_RT5-Dec-06 18:02
Hamid_RT5-Dec-06 18:02 
Questionenumerating users logged on to the windows messenging system Pin
Fabian Tamp5-Dec-06 11:45
Fabian Tamp5-Dec-06 11:45 
AnswerRe: enumerating users logged on to the windows messenging system Pin
Mark Salsbery5-Dec-06 12:22
Mark Salsbery5-Dec-06 12:22 
AnswerRe: enumerating users logged on to the windows messenging system Pin
David Crow5-Dec-06 16:34
David Crow5-Dec-06 16:34 
AnswerRe: enumerating users logged on to the windows messenging system Pin
Fabian Tamp6-Dec-06 18:17
Fabian Tamp6-Dec-06 18:17 
QuestionCheck if file is there or not [modified] Pin
FredrickNorge5-Dec-06 11:38
FredrickNorge5-Dec-06 11:38 
AnswerRe: Check if file is there or not Pin
Mark Salsbery5-Dec-06 12:16
Mark Salsbery5-Dec-06 12:16 
What do you mean fails to process the checks?

How about something like this:
bool FilesClass::FilePath(const char *name)
{ 
	int buffer; 
	int fh;
 
	errno_t errno = _sopen_s( &fh, name, _O_BINARY | _O_RDONLY, _SH_DENYWR, _S_IREAD );
 
	if( errno )
	{ 
		if (errno == ENOENT)
		{
			Files++;
 
			buffer=strlen(name);
			strncat(DllStatus,name,buffer);
			strncat(DllStatus,";",2);
		}
		else
		{
			// _sopen_s() failed!
		}
 
		return false;
	}
	else
	{
		_close( fh );
		return true;
	}
}

The pmode param is required in the call to _sopen_s().

Note that if the file is already opened elsewhere without read share access FilePath() will
return false.
GeneralRe: Check if file is there or not [modified] Pin
FredrickNorge5-Dec-06 12:20
FredrickNorge5-Dec-06 12:20 
AnswerRe: Check if file is there or not Pin
David Crow5-Dec-06 16:43
David Crow5-Dec-06 16:43 
AnswerRe: Check if file is there or not Pin
Hamid_RT5-Dec-06 17:54
Hamid_RT5-Dec-06 17:54 
AnswerRe: Check if file is there or not Pin
ThatsAlok5-Dec-06 22:08
ThatsAlok5-Dec-06 22:08 
QuestionCompare folders Pin
pro.log5-Dec-06 11:04
pro.log5-Dec-06 11:04 
AnswerRe: Compare folders Pin
David Crow5-Dec-06 16:45
David Crow5-Dec-06 16:45 
GeneralRe: Compare folders Pin
pro.log6-Dec-06 3:07
pro.log6-Dec-06 3:07 
GeneralRe: Compare folders Pin
David Crow6-Dec-06 4:01
David Crow6-Dec-06 4:01 
QuestionIs there any way to statically link with kernel32/ntdll? Pin
sunriseway5-Dec-06 10:08
sunriseway5-Dec-06 10:08 
AnswerRe: Is there any way to statically link with kernel32/ntdll? Pin
Zac Howland5-Dec-06 10:16
Zac Howland5-Dec-06 10:16 
Questionsprintf vs strcpy Pin
Blake Miller5-Dec-06 9:02
Blake Miller5-Dec-06 9:02 
AnswerRe: sprintf vs strcpy Pin
David Crow5-Dec-06 9:09
David Crow5-Dec-06 9:09 
AnswerRe: sprintf vs strcpy Pin
Zac Howland5-Dec-06 9:30
Zac Howland5-Dec-06 9:30 
AnswerRe: sprintf vs strcpy Pin
led mike5-Dec-06 9:43
led mike5-Dec-06 9:43 
GeneralRe: sprintf vs strcpy Pin
Zac Howland5-Dec-06 10:00
Zac Howland5-Dec-06 10:00 
GeneralRe: sprintf vs strcpy Pin
led mike5-Dec-06 10:31
led mike5-Dec-06 10:31 
AnswerRe: sprintf vs strcpy Pin
Stephen Hewitt5-Dec-06 12:08
Stephen Hewitt5-Dec-06 12:08 

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.