Article View: borland.public.cppbuilder.nativeapi
Article #7795Re: A problem in a service
From: Eelke
Date: Mon, 20 Dec 2004 08:46
Date: Mon, 20 Dec 2004 08:46
50 lines
2830 bytes
2830 bytes
Malcolm Smith wrote: > I'm forwarding this for a friend who is having trouble with his news reader. > > The code below is used to change some settings for IE and seems to work fine > in an application, but not in a service. I've asked whether the code is run > before/after a logon and asked for the GetLastError() values in order to > track down the problem. He has indicated the boolean return values are true > (hence has not bothered with GetLastError() in this case). His service is > performing the task every 10 seconds and has assured me the timer event is > definitely being called. > > Can anyone provide any information that will help. > > If this is not the best newsgroup, please advise which one to send to. > > TIA. > > > // code below: > > OldProxy is in the form "address:port" for example "localhost:8080" > > > INTERNET_PER_CONN_OPTION_LIST List; > INTERNET_PER_CONN_OPTION Option[2]; > > unsigned long nSize = sizeof(INTERNET_PER_CONN_OPTION_LIST); > > Option[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; > Option[0].Value.pszValue = OldProxy.c_str(); > Option[1].dwOption = INTERNET_PER_CONN_FLAGS; > Option[1].Value.dwValue = PROXY_TYPE_PROXY; > > List.dwSize = sizeof(INTERNET_PER_CONN_OPTION_LIST); > List.pszConnection = NULL; > List.dwOptionCount = 2; > List.dwOptionError = 0; > List.pOptions = Option; > > InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION,&List, nSize); > > InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL,NULL); > > InternetSetOption(NULL, INTERNET_OPTION_REFRESH, NULL,NULL); > > Maybe it has something todo with the fact that services run under the Local system account, and not under the account of the user who logged in. Eelke
Technical Details
Message-ID:
<41c691a0$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.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 Date: Mon, 20 Dec 2004 09:46:48 +0100 From: Eelke <e.klein@mplussoftware.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: A problem in a service References: <41c680e2$1@newsgroups.borland.com> In-Reply-To: <41c680e2$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.58.1.162 Message-ID: <41c691a0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103532448 81.58.1.162 (20 Dec 2004 00:47:28 -0800) Lines: 50 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.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