|
| Author |
Message |
vbuser
Joined: 04 Feb 2008 Posts: 4
|
Posted: Mon Feb 04, 2008 4:33 am Post subject: Internetopen generates Error 20001 |
|
|
Hi,
I'm using the function InternetOpen, InternetConnect and FtpPutFile to put a
file onto a FTP-Server.
Generally it's working very well, every minute a file ist generated.
But about every 14 days i get the error, when using InternetOpen: 20001, No
more handles can be generated.
Of course I use InternetCloseHandle to close then handles, given by
InternetOpen und InternetConnect.
Can anyone help ?
Thanks
Gerard
Archived from group: microsoft>public>vb>winapi |
|
| Back to top |
|
 |
Sinna
Joined: 04 Oct 2007 Posts: 191
|
Posted: Mon Feb 04, 2008 1:17 pm Post subject: Re: Internetopen generates Error 20001 |
|
|
vbuser wrote:
> Hi,
>
>
>
> I'm using the function InternetOpen, InternetConnect and FtpPutFile to put a
> file onto a FTP-Server.
>
> Generally it's working very well, every minute a file ist generated.
>
>
>
> But about every 14 days i get the error, when using InternetOpen: 20001, No
> more handles can be generated.
>
>
>
> Of course I use InternetCloseHandle to close then handles, given by
> InternetOpen und InternetConnect.
>
>
>
> Can anyone help ?
>
>
>
> Thanks
>
> Gerard
>
>
>
>
The error description exactly describes what's happening: you're running
out of resources.
Some suggestions:
- Make sure all handles created are released using InternetCloseHandle
(as you mentioned)
- In general it is good practice to release the handles created in
*reverse* order. In some cases (especially when dealing with objects)
the handle is not released.
- Check if an error occurs, the handles are cleaned up too.
Hope this helps,
Sinna |
|
| Back to top |
|
 |
vbUser
Joined: 06 Feb 2008 Posts: 1
|
Posted: Wed Feb 06, 2008 4:58 pm Post subject: Re: Internetopen generates Error 20001 |
|
|
> vbuser wrote:
>> Hi,
>>
>>
>>
>> I'm using the function InternetOpen, InternetConnect and FtpPutFile to
>> put a file onto a FTP-Server.
>>
>> Generally it's working very well, every minute a file ist generated.
>>
>>
>>
>> But about every 14 days i get the error, when using InternetOpen: 20001,
>> No more handles can be generated.
>>
>>
>>
>> Of course I use InternetCloseHandle to close then handles, given by
>> InternetOpen und InternetConnect.
>>
>>
>>
>> Can anyone help ?
>>
>>
>>
>> Thanks
>>
>> Gerard
>>
>>
>>
>>
> The error description exactly describes what's happening: you're running
> out of resources.
>
> Some suggestions:
> - Make sure all handles created are released using InternetCloseHandle (as
> you mentioned)
> - In general it is good practice to release the handles created in
> *reverse* order. In some cases (especially when dealing with objects) the
> handle is not released.
> - Check if an error occurs, the handles are cleaned up too.
>
> Hope this helps,
> Sinna
Hi Sinna,
thanks für your answer.
I could not find something in my code, which was wrong.
So I'll wait for another 14 days...
Gerhard |
|
| Back to top |
|
 |
Sinna
Joined: 04 Oct 2007 Posts: 191
|
Posted: Thu Feb 07, 2008 1:24 pm Post subject: Re: Internetopen generates Error 20001 |
|
|
vbUser wrote:
>> vbuser wrote:
>>> Hi,
>>>
>>>
>>>
>>> I'm using the function InternetOpen, InternetConnect and FtpPutFile to
>>> put a file onto a FTP-Server.
>>>
>>> Generally it's working very well, every minute a file ist generated.
>>>
>>>
>>>
>>> But about every 14 days i get the error, when using InternetOpen: 20001,
>>> No more handles can be generated.
>>>
>>>
>>>
>>> Of course I use InternetCloseHandle to close then handles, given by
>>> InternetOpen und InternetConnect.
>>>
>>>
>>>
>>> Can anyone help ?
>>>
>>>
>>>
>>> Thanks
>>>
>>> Gerard
>>>
>>>
>>>
>>>
>> The error description exactly describes what's happening: you're running
>> out of resources.
>>
>> Some suggestions:
>> - Make sure all handles created are released using InternetCloseHandle (as
>> you mentioned)
>> - In general it is good practice to release the handles created in
>> *reverse* order. In some cases (especially when dealing with objects) the
>> handle is not released.
>> - Check if an error occurs, the handles are cleaned up too.
>>
>> Hope this helps,
>> Sinna
>
>
> Hi Sinna,
>
> thanks für your answer.
> I could not find something in my code, which was wrong.
> So I'll wait for another 14 days...
>
> Gerhard
>
>
Perhaps you can show us some code (but it will be probably too large).
Sinna
|
|
| Back to top |
|
 |
|
|