|
That was the problem! Now it works perfectly. Thanks, prasad_som!
Rad.
|
|
|
|
|
It seems you find your answer but also see another messages WM_CTLCOLOR* for EDIT,STATIC,LISTBOX and...
|
|
|
|
|
One file is created. I want to set the file attribute as "READ ONLY" from VC++ coding. when file is in read only mode it can not write data. Right click on created file and uncheck the "Read Only" property of file, this file property change information ahould get notified in VC++ code.
After unchecking the file property, it is able to write data into created file.
How to set file permission/property in VC++? and how to get the notification of file property into VC++?
Enjoy Life........
|
|
|
|
|
Poonamol wrote: One file is created. I want to set the file attribute as "READ ONLY" from VC++ coding
SetFileAttributes[^].
Poonamol wrote: and how to get the notification of file property into VC++?
Dont know about this, if it is possible .
|
|
|
|
|
Hello,
Thanks for instant reply,
But still I am facing problrms while removing read only attribute from file properties, this file is not opened for writting data.
Using GetFileAttribute[^] is it possible to get the notification of file properties whether it is read only / write?
Enjoy Life........
|
|
|
|
|
Poonamol wrote: But still I am facing problrms while removing read only attribute from file properties
Can you show code ? you are using.
I'm sure this should work,
SetFileAttributes("filename",FILE_ATTRIBUTE_NORMAL);
See this[^] example for more info.
Poonamol wrote: this file is not opened for writting data.
You need to mention this while opening file.
Poonamol wrote: Using GetFileAttribute[^] is it possible to get the notification of file properties whether it is read only / write?
You can determine whether this file is readonly by using this API.
BTW, why you are mentining 'notifications" here ? Notification are different from what you had mentioned here.
|
|
|
|
|
Can you show how do you use of SetFileAttribute
|
|
|
|
|
This may be a naive answer, but you could use CreateFile() and set to read only access, then close the HANDLE to the file, and then reopen the file using CreateFile() and set the attributes to what ever you need them to be.
That might be a lot of opening and closing though.
I win because I have the most fun in life...
|
|
|
|
|
Hi,
I am using following operations on file.
std::ofstream _logss;
const char * _filename = "xxx.out";
ofstream _logss(_filename,ios::out|ios::trunc);
file.open(_filename,ios::in);
Here I can not use CreateFile().
Please do needful.........
Enjoy Life........
|
|
|
|
|
Hi,
I am using following operations on file.
std::ofstream _logss;
const char * _filename = "xxx.out";
ofstream _logss(_filename,ios::out|ios::trunc);
file.open(_filename,ios::in);
Here I can not use CreateFile().
Please do needful.........
Enjoy Life........
|
|
|
|
|
Hi,
I am using following operations on file.
std::ofstream _logss;
const char * _filename = "xxx.out";
ofstream _logss(_filename,ios::out|ios::trunc);
_logss.open(_filename,ios::out|ios::app);
file.open(_filename,ios::in);
Here I can not use CreateFile().
Please do needful.........
Enjoy Life........
|
|
|
|
|
<br />
SetFileAttributes("d:\\123.txt",FILE_ATTRIBUTE_READONLY);<br />
SetFileAttributes("d:\\123.txt",FILE_ATTRIBUTE_NORMAL);<br />
|
|
|
|
|
Hey,
Here is the code
const char * _filename = "xxxx.out";
std::ofstream _logss;
SetFileAttributes(_filename, FILE_ATTRIBUTE_READONLY);
if(GetFileAttributes(_filename) != FILE_ATTRIBUTE_READONLY)
{
.....
.....
if(_size >MAX_FILE_SIZE )
{
.....
ofstream _logss(_filename,ios::out|ios::trunc);
.....
}
.....
.....
}
Is there any problem in above code?
Enjoy Life........
|
|
|
|
|
Your code is right,what problems?
|
|
|
|
|
I looked up MSDN and found the API function'SetConsoleWindowInfo ' ,which can resize,according to MSDN, the size and position of a console window, however,I tried it and found it doesn't work at all.I don't understand why the API doesn't work on my PC(IDE: VC++ 6.0 OS:WinXP SP2)
Some books says the API function,SetWindowPos,can changes Z order of a child, pop-up, or top-level window.I want to set the console window as the topmost window,so I use the API function ,but I don't know how to get the handle of a console window,I tried to get a console handle by the sentence, ConsoleHnd = GetStdHandle(STD_OUTPUT_HANDLE);
Unfortunately,I got the following error message:
error: argument of type "HANDLE" is incompatible with parameter of type "HWND".
Could anyone give me some suggestions? Thanks!
|
|
|
|
|
mathewzhao wrote: I tried to get a console handle by the sentence, ConsoleHnd = GetStdHandle(STD_OUTPUT_HANDLE);
Unfortunately,I got the following error message:
error: argument of type "HANDLE" is incompatible with parameter of type "HWND".
Use GetConsoleWindow .
|
|
|
|
|
use CreateProcess(..) function to launch a console, you can get handle of the console window there.
GetStdHandle(...) is related to handle of input/output buffer, which are not window's handle.
|
|
|
|
|
i want to send a mail using smtp but i do not want to specify mail address of a particular person
how can i do this
|
|
|
|
|
neha.agarwal27 wrote: i want to send a mail using smtp but i do not want to specify mail address of a particular person
I believe you atleast need to specify one email address, to whom the email is to be sent.
This link[^] would help you.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
|
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I do think you are in SPAM.
remind:
email address is not helpful to hide yourself from punishment at all - fine for first SPAM is 4,000 and second is 1.1 million, this is australia price, I hope you will be fined much cheaper if you are in another country.
|
|
|
|
|
Actually i m not trying to send any spam mail i am woking on website monitoring software .This software will monitor a website if anytime website is down it will send a email to a particular smtp address
that is what i want to do
|
|
|
|
|
then you must use an existing email...
|
|
|
|
|
Hi all,
I am new with storage.i have studied about backup policies.
so i have to implement incremental and differential backup policies.
how can i implement these backup policies in my application.
which algorithm have to apply for the same?
if anybody have idea about the same please share with me.
thanks & regards
bankey
|
|
|
|