Problem with NT registry....


Hi all:

I have a problem with an application that read a value from NT registry. If the NT user is belongs to Administrators group, the application read the value prefect, but when the user is not belongs to Admin. group, the application can not find the value.
I´m using TRegIniFile, but if use TRegistry is the same....

Any idea?

Thanks
MarcelitoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

intheCommented:
Hi
see here :
http://www.maxoutput.com/
there is a component(free unit) to replace registry unit for reading values when not administrator..


Regards Barry
0
intheCommented:
note ,
you will still not be able to write to some keys when not admin(this is nt security reasons)but you should be able to read them all with this .
0
MarcelitoAuthor Commented:
Thanks Barry, but I cannot install this version of component. It´s for Delphi 3 and the PAS file is not included in the zip. Do you have any notice about a newer version of NTReg component?

Regards, Marcelo
0
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

intheCommented:
hehe
i guess you didnt see the link to the source pas file ;-)
it is also on the page in the description about tntregistry.
the link "Here" you will see in description.

nevermind here is direct link:

http://www.maxoutput.com/ntreg.pas

i have installed in d4 and only had to change a couple of integers to cardinals if i remember right..

Regards Barry

0
rwilson032697Commented:
Save yourself the trouble and use TRegistry.OpenKeyReadOnly instead of TRegistry.OpenKey.

No messing around with an additional component you don't need!

Cheers,

Raymond.
0
MarcelitoAuthor Commented:
Thanks inthe, and sorry (I´m not see the link "here"). Any way, when I use the unit, I received an "Access Violation" error at creation of object.
I was looking and the problem appears in the method SetRootKey (the property RootKey is inaccesible)

Regards, Marcelo
0
MarcelitoAuthor Commented:
Hi!

Barry: I fix a problem in my code. The component works perfect. Please, send the answer again and I give you the points. Thanks again.

rwilson: Your solution works also! Thanks for the feedback. I send an ask for you, send me an answer and I give your points!

Thanks all!
0
intheCommented:
ok cheers ;-)

if you only want to read the registry you can use raymonds solution but if you ever need to write to the nt registry then you will need this component for most keys when not logged in as admin.
Regards Barry
0
intheCommented:
null
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.