Article View: borland.public.cppbuilder.nativeapi
Article #7798Re: A problem in a service
From: Remy Lebeau (TeamB)
Date: Mon, 20 Dec 2004 09:52
Date: Mon, 20 Dec 2004 09:52
25 lines
1992 bytes
1992 bytes
"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:
<41c6a111$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41c680e2$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 From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <41c680e2$1@newsgroups.borland.com> Subject: Re: A problem in a service Date: Mon, 20 Dec 2004 01:52:24 -0800 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41c6a111$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103536401 68.69.17.41 (20 Dec 2004 01:53:21 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail