Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2005 Dec : Application takes time to close if it calls InternetOpenA with INTERNET_OPEN_TYP

www.cryer.info
Managed Newsgroup Archive

Application takes time to close if it calls InternetOpenA with INTERNET_OPEN_TYP

Subject:Application takes time to close if it calls InternetOpenA with INTERNET_OPEN_TYP
Posted by:"Sunil Menon" (sun..@volcanomail.com)
Date:20 Dec 2005 00:48:51

Dear All,
   We have developed an application that uses inetsdk for http
communication and have been
facing a weird problem. When our application is closed it takes nearly
one minute to go away from TaskManager or to be precise from memory.
This happens only on some machines. We have found out that we were
using  InternetOpenURL api to call a WebService. Though the execution
of the  process falls through, the application seems to be waiting for
some message  before terminating...
We found out something very unusal....
If in my IE setting I uncheck <Automatically detect settings>, the exe
closes fast...
I check the code and it happens because I have set the flag
Set InternetAccessType = INTERNET_OPEN_TYPE_PRECONFIG
when I do
Set hInternetHandle = InternetOpenA (AppName, InternetAccessType,
sProxyString, '', ITB_INTERNET_FLAG_SYNC)
but if I set the flag as
Set hInternetHandle = InternetOpenA (AppName,
INTERNET_OPEN_TYPE_DIRECT, '', '', 0)

then even if the <Automatically detect settings> is checked, the exe
closes fast...
as per my information INTERNET_OPEN_TYPE_DIRECT is usually used for ftp
and not for htttp.
Can I use this flag for http also? What is the significane of this
switch?

Please help...

Thanks & regards
Sunil

Replies:

www.cryer.info
Managed Newsgroup Archive