|
Nick_Chr wrote: But unfortunately this example didn't help.
Why?
Notice how the SECURITY_ATTRIBUTES variable, sa , is populated prior to calling RegCreateKeyEx() . That's what you need to do. You may not need all of that code, but the general idea is definitely there.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Never ever use KEY_ALL_ACCESS . Pass only the privs you need, in this case KEY_SET_VALUE .
|
|
|
|
|
Thank you DavidCrow and Michael Dunn for your answers.
I managed to find the solution to the problem. Apparently Vista is using a new security component named User Account Control (UAC). When it is switched on you have to ask for permision to have full access from the user.
I don't know how right or wrong my solution is, but what I found is to use a wrapper executable file that executes my main app. To do this I used the ShellExecute call passing as operation the "RunAs" keyword. Doing this it asks for permision to run my main app, and from there my first code worked as in XP without any problems...
Thank you again for your help.
Nick...
|
|
|
|
|
I HAVE TO write a programm that can erase all data from hard drive
that no one can recover it again.There are planty of algorithms that can do
that and I wanna use them in my programm.I have to write it for my exam pro
ject at university. Any help?? PLIZ...sorry for my English couse i`m not Pol
ish.
|
|
|
|
|
Buy a big hammer!
Seriously, you'll struggle to really delete everything (since the OS will need some kind of access to the drive) - Do you want to kill off the FAT/NTFS tables, MBR, etc, too?
Most file shredders work by opening the file to be destroyed, and just overwriting it with random data multiple times. Repeat for each file you want to get rid of. This should be achievable in a few dozen lines of code. If you've already deleted all the files, then you'd just need to create a single file that fills the entire capacity of the drive, and keep writing garbage to that, until you're happy (run it a few times, then see if you can make undelete tools work)
|
|
|
|
|
benjymous wrote: Buy a big hammer!
If the data is truely that sensitive that one has to go to those extremes then a hammer will not be good enough, one can always read the data off the bits of pieces left over. The best way to truely destroy the drive is to open it up and melt down the disk platter so all that is left is a puddle of molten metal.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Bah. No doubt there's someone out there who could restore it to its original form.
Dump it into the supermassive black hole at the center of our galaxy.
Software Zen: delete this;
|
|
|
|
|
Now, lets not go to extremes. Shooting it into the sun should be good enough.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
If you have an algorithm whats problem?
|
|
|
|
|
Is formatting the drive an option?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
No, it is`nt i would be too easy :/ some guys with some cool programms can recover any data even after formatting. Formatting the hard drive just create another allocation table, but if you want to you can find many ways (or shareware ) programs) to get the data back :/ it could be a part of my programm...formatting the hard drive...but the most important is that i want to use my small programm: delete some or all data from hdd and then use one of many well known programms for recovering deleted data and just show that would be impossible thanks to my application or script whatever...i`m still looking for someone who was doing simillar stuff and have those working algorithms. but thanks a lot guys...that were really thunder speed answers
|
|
|
|
|
plzz can anyone tell
how can we switch the values of two variables without using a 3rd variable in C
Thanx
Maryum
|
|
|
|
|
int i,j;
i =2 ;
j= 3;
i = i + j;
j = i - j ;
i = i -j;
I guess this is interview question.
-- modified at 7:22 Friday 20th October, 2006
|
|
|
|
|
Why?
Sounds like a homework question again.
Try Google[^]
|
|
|
|
|
thanx for ur help actually someone asked me that question and i did'nt know that its possible.
thanx again
bye
Maryum
|
|
|
|
|
No, you can't.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Just use the XOR operator.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You can if you're a university lecturer who likes posing useless questions.
But as to why you'd want to, I'm stumped - it creates evil looking nonsensical code
|
|
|
|
|
I would need to create icon during program run (independently of resource); it seems to me that the 'inner' format of icon can't be complicated, but I was not able to find description of it.
Or, alternatively, is there some possibility to convert bitmap object into the icon object?
Thanks for help and/or advice!
|
|
|
|
|
Do you have icons in out your program or you want to create them?
|
|
|
|
|
petrkar wrote: ...but I was not able to find description of it.
Try here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Dear all
how to build a Head file which include three classes? for instance, the Head file is img.h, three classes are tagColorRGB, tagColorRGBA, tagFloatPoint.
thank you.
Li Zhiyuan
20/10/2006
|
|
|
|
|
One at a time.
Seriously, if you need to do this, just lay them out in a row. The only trick is if they refer to each other, but you can forward declare them if need be.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to read a line from a file which consist number of lines.In mfc library there is no function for "fgets"( am opening this file "CFile::Open(.....) function,with sharedeny access flagcheck).If any one can give me the hint to how to write this generic functiopnality using mfc, i'll be gratefull.
kamalesh
|
|
|
|
|