views:

46

answers:

1

Hi,

I am working on a sample which send file to server. To send file to server I am using WinHttpSendRequest() API. In my machine It worked fine. But for some other machine it is not working. It gives the error ERROR_WINHTTP_CANNOT_CONNECT(12029). I checked the Firewall setting; it is same as my machine.

Please let me know why I am getting this error.

Update: once after searching in the net, I think firewall is blocking the connection. I installed 3rd party Firewall and blocked all network operation in firewall. Once after blocking, I got 12029 errors. My question is: is it possible to identify weather our request is blocked by firewall? Please help me to solve this problem.

A: 

You could use the Windows Firewall API to check if certain ports are open or if your program has access. You can also use the API to configure the firewall to allow your program access if neccessary. Here are a few examples of using the interface:

http://msdn.microsoft.com/en-us/library/aa364726(VS.85).aspx

http://nsclient.org/nscp/browser/branches/stable/helpers/installer_dll_fw/firewall.cpp?rev=184

http://ultravnc.hg.sourceforge.net/hgweb/ultravnc/ultravnc/file/28d4e56ffaeb/UltraVNCv2/uvnc_settings/uvnc_settings/firewall.cpp

Garett
Thanks for your replay, I will try this and let you know the result. Once again thanks for the response.
Umesha MS