Discussion:
Application takes time to close if it calls InternetOpenA with INTERNET_OPEN_TYPE_PRECONFIG flag
(too old to reply)
Sunil Menon
2005-12-20 08:48:51 UTC
Permalink
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
Scherbina Vladimir
2005-12-21 20:41:01 UTC
Permalink
I've never met such problem. Do you close all HINTERNET handles before
exiting ?
--
Vladimir
Post by Sunil Menon
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
Sunil Menon
2005-12-23 08:07:04 UTC
Permalink
The datatype is long in Oracle...

Many regards
Sunil
Post by Scherbina Vladimir
I've never met such problem. Do you close all HINTERNET handles before
exiting ?
--
Vladimir
Post by Sunil Menon
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
Sunil Menon
2005-12-23 10:35:00 UTC
Permalink
Ooops...I meant yes....we do close all handles...
Scherbina Vladimir
2005-12-23 12:11:10 UTC
Permalink
Can you attach debugger to your application and trace where it hungs ?

--
Vladimir
Post by Sunil Menon
Ooops...I meant yes....we do close all handles...
Loading...