|
Prevent who ?
You could open the file with CFile and use one of the flag to prevent other processed to access it.
|
|
|
|
|
You would need to set this restriction at the OS level.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Create a service which opens an exclusive handle to the file. This will prevent copying and deleting.
|
|
|
|
|
If maybe, you can demonstrate how you do it? Because, I don't still understand you. Can you help me!!! Please!!!
Thank you very much!
|
|
|
|
|
Using the mfc CFile class
CString file_name = _T("C:\\AnotherFile");
CFile f;
f.Open( file_name, CFile::modeRead | CFile::shareExclusive );
while(1)
Sleep(1000);
|
|
|
|
|
Hi all,
I would like to know wheter there is any way (using code) in which I can get hold of the system log, in terms of, when Windows has finished downloading updates and needs to restart. See the reason I'm asking is because some of our computer are never used by users, but still need security updates, and in the light that after every update Windows needs a restart, there will be no user to do so. Any suggestion ??
Many Thanks
Reagrds,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: in which I can get hold of the system log
You mean you want to read the eventlog? check ReadEventLog()..
|
|
|
|
|
|
Sorry just another quick question:
Am I correct to say that I can locate the event log in the following directory:
C:\Windows\system32\config\AppEvent.Evt
Many Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Am I correct to say that I can locate the event log in the following directory:
Eventhough by default the file for "Application" events comes in the above mentioed path, it can be changed by changing the values in registy. Search the registry for value "C:\Windows\system32\config\AppEvent.Evt"
|
|
|
|
|
|
I'm looking at the following example, and I'm not sure what parameeters to pass to the function:
Querying for Event Information[^]
Could you please help?
Thanks again .....
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
|
Thanks for the info Hamid
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi All,
How to find out whether my system is 16, 32 or 64 bit ? both by programmatically and manullay ????
|
|
|
|
|
I dont know whether there is any window APIs for this. But you can get this information using WMI. check the Win32_Processor class.
|
|
|
|
|
Call IsWow64Process() to tell if the OS is 32-bit or 64-bit.
|
|
|
|
|
As a hack you could use sizeof(int*) (any type will do, not just int).
Or, sizeof(int) for 16/32.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi,
I have a control which is using GDI+ and window region.
The below code is used for setting the window region.
GraphicsPath gp;
Region rgn( &gp );
Graphics g( hdc );
HRGN hRgn = rgn.GetHRGN( &g );
SetWindowRgn( hRgn, FALSE );
And in the OnPaint, the following is used for drawing the border.
GraphicsPath gp;
LinearGradientBrush brush( ... );
Pen pen( &brush, 1 );
Graphics g( hdc );
g.DrawPath( &pen, &gp );
The issue is that there is a slight difference between the drawn path and the set region. That means the path is not exactly fit in the window region. There are some gaps in many places. So drawing cannot be perfect. I am seeking for a solution to this, as CDC::FrameRgn do. I cant use this FrameRgn, since I need a gradient coloring in the path.
Thanks in advance.
- NS -
|
|
|
|
|
When you say does not fit, what are the effects?
Do you mean you've drawn the region using GDI and then with GDI+ and they are close but not exactly the same?
|
|
|
|
|
bob16972 wrote: you've drawn the region using GDI and then with GDI+
Nop... the window region set is a little bit different than the path drawn by using GDI+. So there are some holes (area that's not drawn) in the edges of the window.
- NS -
|
|
|
|
|
I have encountered Access violation reading location with this code:
IConverterSession* sample;
sample = NULL;
IStream *istream;
istream = 0;
sample->SetEncoding(IET_QP);
sample->SetSaveFormat(SAVE_RFC822);
hResult = sample->MAPIToMIMEStm(LPMESSAGE(msgName.c_str()), istream, CCSF_SMTP);
if (hResult !=S_OK){
throw(HResultException("MAPIToMIMEStm ResolveMsg",0));
}
I am really new to this can anyone guide me in making this work?
Thanks a lot,
Jj
|
|
|
|
|
sample = NULL;<br />
....<br />
sample->SetEncoding(IET_QP);
Guess what will happen when you call a function on a NULL pointer ?
You first need to create an object (do you need to use pointers here, can't you simply create an instance of IConverterSession ?)
By the way, the debugger is your best friend
|
|
|
|
|
I am using CWebBrowser2 wrapper in my dialog based application.
In the OnInitDialog() function I am calling Navigate() function of CWebBrowser2.
If the internet connection is not available on a machine then how can I generally detect that so that I can display some default thing in CWebBrowser2 control.
Can it be detected using CWebBrowser2 ?
Thanks.
|
|
|
|