Discussion:
InternetGetProxyInfo() fails with ERROR_CAN_NOT_COMPLETE result
(too old to reply)
Voronkov Konstantin
2007-05-11 16:47:42 UTC
Permalink
Hello, All!

I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195

Sometimes the InternetGetProxyInfo() API returns 1003 ERROR_CAN_NOT_COMPLETE
result.

Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?

The problem is that I need to detect proxy server several times during one
session from different threads of my applicaiton.



It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that did
not done the job.

Thanks in advance,
Voronkov Konstantin
Paul Baker [MVP, Windows - SDK]
2007-05-11 16:53:10 UTC
Permalink
The KB article says "This problem may occur when the application tries to
retrieve the proxy configuration script for the first time. However, the
application may succeed in retrieving the proxy configuration script on
later requests.".

Did you try calling InternetGetProxyInfo a second time to see if it
succeeds?

Why do you need to call it several times from different threads? Do you
expect the proxy to change and do you require your application to
immediately take the change into account? If not, you can make just one
successful call and save the results.

Paul
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during one
session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that did
not done the job.
Thanks in advance,
Voronkov Konstantin
Voronkov Konstantin
2007-05-11 17:22:17 UTC
Permalink
Hello, Paul!
Post by Paul Baker [MVP, Windows - SDK]
Did you try calling InternetGetProxyInfo
a second time to see if it succeeds?
I tried (I wrote that bit below).
Post by Paul Baker [MVP, Windows - SDK]
Why do you need to call it several times from different threads?
I need know proxy server address and this may happen in any thread,
because application is designed in that way.
Post by Paul Baker [MVP, Windows - SDK]
Do you expect the proxy to change and do you require your
application to immediately take the change into account?
I do. Not exact this case, but I expect different proxy
server address may be returned for different URLs.
That is why I do not cache proxy server address.
Post by Paul Baker [MVP, Windows - SDK]
you can make just one successful call and save the results
I will, if nothing else helps.


Thanks for your help,
Voronkov Konstantin
Post by Paul Baker [MVP, Windows - SDK]
The KB article says "This problem may occur when the application tries to
retrieve the proxy configuration script for the first time. However, the
application may succeed in retrieving the proxy configuration script on
later requests.".
Did you try calling InternetGetProxyInfo a second time to see if it
succeeds?
Why do you need to call it several times from different threads? Do you
expect the proxy to change and do you require your application to
immediately take the change into account? If not, you can make just one
successful call and save the results.
Paul
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during
one session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that
did not done the job.
Thanks in advance,
Voronkov Konstantin
Voronkov Konstantin
2007-05-11 18:59:21 UTC
Permalink
I have one more question if someone knows a library to parse WPAD script
without dependecy from JSProxy.dll ?

Regards,
Konstantin
Post by Voronkov Konstantin
Hello, Paul!
Post by Paul Baker [MVP, Windows - SDK]
Did you try calling InternetGetProxyInfo
a second time to see if it succeeds?
I tried (I wrote that bit below).
Post by Paul Baker [MVP, Windows - SDK]
Why do you need to call it several times from different threads?
I need know proxy server address and this may happen in any thread,
because application is designed in that way.
Post by Paul Baker [MVP, Windows - SDK]
Do you expect the proxy to change and do you require your
application to immediately take the change into account?
I do. Not exact this case, but I expect different proxy
server address may be returned for different URLs.
That is why I do not cache proxy server address.
Post by Paul Baker [MVP, Windows - SDK]
you can make just one successful call and save the results
I will, if nothing else helps.
Thanks for your help,
Voronkov Konstantin
Post by Paul Baker [MVP, Windows - SDK]
The KB article says "This problem may occur when the application tries to
retrieve the proxy configuration script for the first time. However, the
application may succeed in retrieving the proxy configuration script on
later requests.".
Did you try calling InternetGetProxyInfo a second time to see if it
succeeds?
Why do you need to call it several times from different threads? Do you
expect the proxy to change and do you require your application to
immediately take the change into account? If not, you can make just one
successful call and save the results.
Paul
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during
one session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that
did not done the job.
Thanks in advance,
Voronkov Konstantin
Alexander Nickolov
2007-05-11 23:22:58 UTC
Permalink
SpiderMonkey springs to mind... That's what Firefox uses IIRC.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: ***@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
Post by Voronkov Konstantin
I have one more question if someone knows a library to parse WPAD script
without dependecy from JSProxy.dll ?
Regards,
Konstantin
Post by Voronkov Konstantin
Hello, Paul!
Post by Paul Baker [MVP, Windows - SDK]
Did you try calling InternetGetProxyInfo
a second time to see if it succeeds?
I tried (I wrote that bit below).
Post by Paul Baker [MVP, Windows - SDK]
Why do you need to call it several times from different threads?
I need know proxy server address and this may happen in any thread,
because application is designed in that way.
Post by Paul Baker [MVP, Windows - SDK]
Do you expect the proxy to change and do you require your
application to immediately take the change into account?
I do. Not exact this case, but I expect different proxy
server address may be returned for different URLs.
That is why I do not cache proxy server address.
Post by Paul Baker [MVP, Windows - SDK]
you can make just one successful call and save the results
I will, if nothing else helps.
Thanks for your help,
Voronkov Konstantin
Post by Paul Baker [MVP, Windows - SDK]
The KB article says "This problem may occur when the application tries
to retrieve the proxy configuration script for the first time. However,
the application may succeed in retrieving the proxy configuration script
on later requests.".
Did you try calling InternetGetProxyInfo a second time to see if it
succeeds?
Why do you need to call it several times from different threads? Do you
expect the proxy to change and do you require your application to
immediately take the change into account? If not, you can make just one
successful call and save the results.
Paul
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during
one session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that
did not done the job.
Thanks in advance,
Voronkov Konstantin
Voronkov Konstantin
2007-05-12 08:11:56 UTC
Permalink
Thanks a lot,

I'll try that.

Konstantin
Post by Alexander Nickolov
SpiderMonkey springs to mind... That's what Firefox uses IIRC.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
Post by Voronkov Konstantin
I have one more question if someone knows a library to parse WPAD script
without dependecy from JSProxy.dll ?
Regards,
Konstantin
Post by Voronkov Konstantin
Hello, Paul!
Post by Paul Baker [MVP, Windows - SDK]
Did you try calling InternetGetProxyInfo
a second time to see if it succeeds?
I tried (I wrote that bit below).
Post by Paul Baker [MVP, Windows - SDK]
Why do you need to call it several times from different threads?
I need know proxy server address and this may happen in any thread,
because application is designed in that way.
Post by Paul Baker [MVP, Windows - SDK]
Do you expect the proxy to change and do you require your
application to immediately take the change into account?
I do. Not exact this case, but I expect different proxy
server address may be returned for different URLs.
That is why I do not cache proxy server address.
Post by Paul Baker [MVP, Windows - SDK]
you can make just one successful call and save the results
I will, if nothing else helps.
Thanks for your help,
Voronkov Konstantin
Post by Paul Baker [MVP, Windows - SDK]
The KB article says "This problem may occur when the application tries
to retrieve the proxy configuration script for the first time. However,
the application may succeed in retrieving the proxy configuration
script on later requests.".
Did you try calling InternetGetProxyInfo a second time to see if it
succeeds?
Why do you need to call it several times from different threads? Do you
expect the proxy to change and do you require your application to
immediately take the change into account? If not, you can make just one
successful call and save the results.
Paul
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during
one session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that
did not done the job.
Thanks in advance,
Voronkov Konstantin
Voronkov Konstantin
2007-05-15 08:01:32 UTC
Permalink
Hello, All!

I found the root of the problem was CoInitialize() call in mine
applicaition.
The switch to mutithreaded appartement solved all problems.

I found that JSProxy uses COM and it can not work properly in case other
appartement COM initializaiton is performed on the same thread.

Best Regards,
Voronkov Konstantin
Post by Voronkov Konstantin
Hello, All!
I'm expierencing behaviour described in MS article
http://support.microsoft.com/default.aspx/kb/931195
Sometimes the InternetGetProxyInfo() API returns 1003
ERROR_CAN_NOT_COMPLETE result.
Can I fight the problem in any way? Is there any workaround to use my
applicaiton without installing MS patch?
The problem is that I need to detect proxy server several times during one
session from different threads of my applicaiton.
It is said in MSDN
This problem may occur when the application tries
to retrieve the proxy configuration script for the first time.
I tried to repeat InternetGetProxyInfo() calls but unfortunatelly that did
not done the job.
Thanks in advance,
Voronkov Konstantin
Loading...