|
As said by Leah_Garett,
It may be bacause of some clean-up code. You need to debug it. Or tell exact error message.
|
|
|
|
|
|
Is there a way to do this? I am familiar with setting the alphablend levels on the main window and making it transparent but when I try to do the same for child windows nothing ever happens.
|
|
|
|
|
If you want to transparent window I think you can see an example of codeproject about it.I think It has four window that are transparent (child window)
|
|
|
|
|
Hi,
If anyone's not familiar with the windows "net" program, it sends messages to people based on a given user or computer alias.
Does anyone know how to enumerate these aliases? I've basically scoured the web. I'm looking for a way to do it in C++, and i'm thinking that there's probably some kind of obscure networking function that I've missed.
Thanks for your help everyone.
SwITCh?!
|
|
|
|
|
Does WNetOpenEnum() give you what you're looking for?
|
|
|
|
|
Fabian Tamp wrote: If anyone's not familiar with the windows "net" program, it sends messages to people...
That's "net send" actually. "Net" by itself does nothing.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey, thanks for the help.
I don't think WNetOpenEnum was quite what i was looking for, but through that i found NetQueryDisplayInformation, which is closer to what i want.
The comment about the program being "net send", the program is actually "net", but "send" is an argument it takes. therefore "net send" is used to send a message using the "net" program. On that note, the "net" program has alot of extra useful functionality which i might try out.
Thanks for your help guys.
SwITCh?!
|
|
|
|
|
I curently have this code
bool FilesClass::FilePath(char name[50])
{ int buffer;
int fh;
if( _sopen_s( &fh, name, _O_BINARY, _SH_DENYWR, 0 ) )
{
Files++;
buffer=strlen(name);
strncat(DllStatus,name,buffer);
strncat(DllStatus,";",2);
return false;
}
else
return true;
}
But in some cases it fails to process the checks, and asserts with cant open file.
My idea is that this function either returns true if the file is present, or false if its not, any sugestions?
-- modified at 17:45 Tuesday 5th December, 2006
|
|
|
|
|
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
{
}
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.
|
|
|
|
|
Ok, found my assert problem as well, i actualy check for total of 6222 files, array was to short.
Thanks, your code worked better.
-- modified at 18:26 Tuesday 5th December, 2006
|
|
|
|
|
FredrickNorge wrote: My idea is that this function either returns true if the file is present, or false if its not, any sugestions?
_access(..., 0) sounds a whole lot simpler.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In additinal yo can use of FindFirstFile
|
|
|
|
|
FredrickNorge wrote:
My idea is that this function either returns true if the file is present, or false if its not, any sugestions?
try PathFileExists
<div class='ForumSig'>"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you </div>
|
|
|
|
|
I need some help about the code i must write so the program will compare the files of 2 folders and find the number of the different files. thanks in advance.
|
|
|
|
|
pro.log wrote: ...different files.
Which could be any number of things (e.g., size, date, contents). Please elaborate.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
just for the contents of the 2 folders
|
|
|
|
|
So just add the contents of each folder to its own array. If the size of the arrays are different, or if one array has an item that the other does not, then you know the folders are indeed different.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi Forum,
Is it possible to write a simple hello world win32 application which is statically linked with kernel32 and ntdll? When I run the ap, only the executable image should be in memory and no other modules (including the kernel32/ntdll which are normally loaded). I want to build a fully self-contained executable. Is that doable?
Thanks in advance for any information.
|
|
|
|
|
sunriseway wrote: I want to build a fully self-contained executable. Is that doable?
Short answer: no.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
So I see a lot of code like this lately:
sprintf(pUserPwd, "%s", oVerifedWriteDlg.m_UserPwd);
Why use that instead of just going with strcpy?
strcpy(pUserPwd, oVerifedWriteDlg.m_UserPwd);
Am I missing something?
I am inclined to think the sprintf would be a lot slower ...
|
|
|
|
|
My personal preference would me to use strcpy() , unless I was constantly changing what I wanted in pUserPwd (e.g., padding, numbers, justification, additional variables).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Laziness is the main culprit there. The sprintf version is far more likely to introduce buffer overrun bugs (e.g. if the wrong delimeter is used).
Note that the safer operations are actually to use the std::string class, or at the very least, the strncpy function (or its variants).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
If you are writing for Windows only (not cross-platform) you should use the safe string routines
strcpy == StringCchCopy[^]
led mike
|
|
|
|
|
led mike wrote: If you are writing for Windows only (not cross-platform) you should use the safe string routines
strcpy == StringCchCopy[^]
Or the slightly more familiar (syntax-wise) replacements: strXXX_s
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|