Article View: borland.public.cppbuilder.nativeapi
Article #7794A problem in a service
From: Malcolm Smith
Date: Mon, 20 Dec 2004 07:36
Date: Mon, 20 Dec 2004 07:36
47 lines
2462 bytes
2462 bytes
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); -- Malcolm Smith
Technical Details
Message-ID:
<41c680e2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ca53487bc8179511,start 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 Subject: A problem in a service Date: Mon, 20 Dec 2004 18:36:42 +1100 Lines: 49 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: <41c680e2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103528162 211.30.147.112 (19 Dec 2004 23:36:02 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail