msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Internetopen generates Error 20001

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI
Author Message
vbuser



Joined: 04 Feb 2008
Posts: 4

PostPosted: Mon Feb 04, 2008 4:33 am    Post subject: Internetopen generates Error 20001 Reply with quote

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
View user's profile Send private message
Sinna



Joined: 04 Oct 2007
Posts: 191

PostPosted: Mon Feb 04, 2008 1:17 pm    Post subject: Re: Internetopen generates Error 20001 Reply with quote

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
View user's profile Send private message
vbUser



Joined: 06 Feb 2008
Posts: 1

PostPosted: Wed Feb 06, 2008 4:58 pm    Post subject: Re: Internetopen generates Error 20001 Reply with quote

> 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
View user's profile Send private message
Sinna



Joined: 04 Oct 2007
Posts: 191

PostPosted: Thu Feb 07, 2008 1:24 pm    Post subject: Re: Internetopen generates Error 20001 Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group