Article View: borland.public.cppbuilder.nativeapi
Article #7800Re: A problem in a service
From: Malcolm Smith
Date: Mon, 20 Dec 2004 10:35
Date: Mon, 20 Dec 2004 10:35
49 lines
2563 bytes
2563 bytes
Remy, I'll pass the information on. He is passing NULL because he wants to change the default settings, but I am assuming he is not impersonating. Hopefully this will be enough for him t resolve. if not I'll be back.... Thanks. -- Malcolm Smith MJ Freelancing http://www.mjfreelancing.com Borland Technology Partner Contributing Editor C++Builder Developers Journal http://bcbjournal.org "Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:41c6a111$1@newsgroups.borland.com... > > "Malcolm Smith" <mjfreelancing@optusnet.com.au> wrote in message > news:41c680e2$1@newsgroups.borland.com... > > > InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION,&List, > nSize); > > > > InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL,NULL); > > > > InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL,NULL); > > InternetSetOption() expects an HINTERNET handle as the first input > parameter. You are not providing one. You need to call InternetOpen() > first. Specifying NULL means that you are trying to change the default > values, but those values are stored in the HKEY_CURRENT_USER key of the > Registry, which a service does not have access to by default. You have to > impersonate a user login in order to change a particular user's Registry > settings from a service. Look at LogonUser(), ImpersonateLoggedOnUser(), > and RevertToSelf(). > > Asside from that, please also provide the actual return values from both > InternetSetOption() and GetLastError(). > > > Gambit > >
Technical Details
Message-ID:
<41c6ab9e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41c680e2$1@newsgroups.borland.com> <41c6a111$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca53487bc8179511 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Malcolm Smith" <mjfreelancing@optusnet.com.au> From: "Malcolm Smith" <mjfreelancing@optusnet.com.au> Newsgroups: borland.public.cppbuilder.nativeapi References: <41c680e2$1@newsgroups.borland.com> <41c6a111$1@newsgroups.borland.com> Subject: Re: A problem in a service Date: Mon, 20 Dec 2004 21:35:32 +1100 Lines: 51 Organization: MJ Freelancing X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 211.30.147.112 Message-ID: <41c6ab9e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103539102 211.30.147.112 (20 Dec 2004 02:38:22 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail