<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[WinHTTP Problem - hostName und objectName]]></title><description><![CDATA[<p>Hallo Community,</p>
<p>Ich möchte einen recht simple GET (später dann POST) Anfragemachen an <a href="http://funpic.de" rel="nofollow">funpic.de</a> machen. Jedoch funktioniert dies nicht.</p>
<p>Ich habe schon <a href="http://funpic.de" rel="nofollow">funpic.de</a>, <a href="http://www.funpic.de" rel="nofollow">www.funpic.de</a>, <a href="http://funpic.de" rel="nofollow">http://funpic.de</a>, <a href="http://www.funpic.de" rel="nofollow">http://www.funpic.de</a> probiert, nichts klappt.</p>
<pre><code>C++:
ERROR_WINHTTP_CANNOT_CONNECT 12029 Returned if connection to the server failed.
</code></pre>
<p>Finde leider den Fehler nicht, da es mit <a href="http://www.google.de" rel="nofollow">www.google.de</a> prima klappt!</p>
<p>Der Code ist von hier:<br />
<a href="http://msdn.microsoft.com/en-us/library/aa384270%28VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa384270(VS.85).aspx</a></p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;Winhttp.h&gt;

#include &lt;iostream&gt;
using namespace std;

int main(wchar_t **argv, int argc)
{
    LPCWSTR pswzServerName =  L&quot;funpic.de&quot;;
	LPCWSTR pswzObjectName = L&quot;&quot;;

	DWORD dwSize = 0;
	DWORD dwDownloaded = 0;
	LPSTR pszOutBuffer;
	BOOL  bResults = FALSE;
	HINTERNET  hSession = NULL, 
	hConnect = NULL,
	hRequest = NULL;

	// Use WinHttpOpen to obtain a session handle.
	hSession = WinHttpOpen( L&quot;WinHTTP Example/1.0&quot;, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
						WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0 );

	// Specify an HTTP server.
	if( hSession )
		hConnect = WinHttpConnect( hSession, pswzServerName, INTERNET_DEFAULT_HTTPS_PORT, 0 );

	// Create an HTTP request handle.
	if( hConnect )
		hRequest = WinHttpOpenRequest( hConnect, L&quot;GET&quot;, pswzObjectName, NULL, WINHTTP_NO_REFERER, 
									WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE );

	// Send a request.
	if( hRequest )
		bResults = WinHttpSendRequest( hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
									WINHTTP_NO_REQUEST_DATA, 0, 0, 0 );

	// End the request.
	if( bResults )
		bResults = WinHttpReceiveResponse( hRequest, NULL );

	// Keep checking for data until there is nothing left.
	if( bResults )
	{
		do 
		{
			// Check for available data.
			dwSize = 0;
			if( !WinHttpQueryDataAvailable( hRequest, &amp;dwSize ) )
				printf( &quot;Error %u in WinHttpQueryDataAvailable.\n&quot;, GetLastError( ) );

			// Allocate space for the buffer.
			pszOutBuffer = new char[dwSize+1];
			if( !pszOutBuffer )
			{
				printf( &quot;Out of memory\n&quot; );
				dwSize=0;
			}
			else
			{
				// Read the data.
				ZeroMemory( pszOutBuffer, dwSize+1 );

				if( !WinHttpReadData( hRequest, (LPVOID)pszOutBuffer, 
								dwSize, &amp;dwDownloaded ) )
					printf( &quot;Error %u in WinHttpReadData.\n&quot;, GetLastError( ) );
				else
					printf( &quot;%s&quot;, pszOutBuffer );

					// Free the memory allocated to the buffer.
				delete [] pszOutBuffer;
			}
		} while( dwSize &gt; 0 );
	}

	// Report any errors.
	if( !bResults )
	printf( &quot;Error %d has occurred.\n&quot;, GetLastError( ) );

	// Close any open handles.
	if( hRequest ) WinHttpCloseHandle( hRequest );
	if( hConnect ) WinHttpCloseHandle( hConnect );
	if( hSession ) WinHttpCloseHandle( hSession );

	cin.get();
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/316458/winhttp-problem-hostname-und-objectname</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 00:10:49 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/316458.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 04 May 2013 16:53:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WinHTTP Problem - hostName und objectName on Sat, 04 May 2013 17:59:12 GMT]]></title><description><![CDATA[<p>Hallo Community,</p>
<p>Ich möchte einen recht simple GET (später dann POST) Anfragemachen an <a href="http://funpic.de" rel="nofollow">funpic.de</a> machen. Jedoch funktioniert dies nicht.</p>
<p>Ich habe schon <a href="http://funpic.de" rel="nofollow">funpic.de</a>, <a href="http://www.funpic.de" rel="nofollow">www.funpic.de</a>, <a href="http://funpic.de" rel="nofollow">http://funpic.de</a>, <a href="http://www.funpic.de" rel="nofollow">http://www.funpic.de</a> probiert, nichts klappt.</p>
<pre><code>C++:
ERROR_WINHTTP_CANNOT_CONNECT 12029 Returned if connection to the server failed.
</code></pre>
<p>Finde leider den Fehler nicht, da es mit <a href="http://www.google.de" rel="nofollow">www.google.de</a> prima klappt!</p>
<p>Der Code ist von hier:<br />
<a href="http://msdn.microsoft.com/en-us/library/aa384270%28VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa384270(VS.85).aspx</a></p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;Winhttp.h&gt;

#include &lt;iostream&gt;
using namespace std;

int main(wchar_t **argv, int argc)
{
    LPCWSTR pswzServerName =  L&quot;funpic.de&quot;;
	LPCWSTR pswzObjectName = L&quot;&quot;;

	DWORD dwSize = 0;
	DWORD dwDownloaded = 0;
	LPSTR pszOutBuffer;
	BOOL  bResults = FALSE;
	HINTERNET  hSession = NULL, 
	hConnect = NULL,
	hRequest = NULL;

	// Use WinHttpOpen to obtain a session handle.
	hSession = WinHttpOpen( L&quot;WinHTTP Example/1.0&quot;, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
						WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0 );

	// Specify an HTTP server.
	if( hSession )
		hConnect = WinHttpConnect( hSession, pswzServerName, INTERNET_DEFAULT_HTTPS_PORT, 0 );

	// Create an HTTP request handle.
	if( hConnect )
		hRequest = WinHttpOpenRequest( hConnect, L&quot;GET&quot;, pswzObjectName, NULL, WINHTTP_NO_REFERER, 
									WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE );

	// Send a request.
	if( hRequest )
		bResults = WinHttpSendRequest( hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
									WINHTTP_NO_REQUEST_DATA, 0, 0, 0 );

	// End the request.
	if( bResults )
		bResults = WinHttpReceiveResponse( hRequest, NULL );

	// Keep checking for data until there is nothing left.
	if( bResults )
	{
		do 
		{
			// Check for available data.
			dwSize = 0;
			if( !WinHttpQueryDataAvailable( hRequest, &amp;dwSize ) )
				printf( &quot;Error %u in WinHttpQueryDataAvailable.\n&quot;, GetLastError( ) );

			// Allocate space for the buffer.
			pszOutBuffer = new char[dwSize+1];
			if( !pszOutBuffer )
			{
				printf( &quot;Out of memory\n&quot; );
				dwSize=0;
			}
			else
			{
				// Read the data.
				ZeroMemory( pszOutBuffer, dwSize+1 );

				if( !WinHttpReadData( hRequest, (LPVOID)pszOutBuffer, 
								dwSize, &amp;dwDownloaded ) )
					printf( &quot;Error %u in WinHttpReadData.\n&quot;, GetLastError( ) );
				else
					printf( &quot;%s&quot;, pszOutBuffer );

					// Free the memory allocated to the buffer.
				delete [] pszOutBuffer;
			}
		} while( dwSize &gt; 0 );
	}

	// Report any errors.
	if( !bResults )
	printf( &quot;Error %d has occurred.\n&quot;, GetLastError( ) );

	// Close any open handles.
	if( hRequest ) WinHttpCloseHandle( hRequest );
	if( hConnect ) WinHttpCloseHandle( hConnect );
	if( hSession ) WinHttpCloseHandle( hSession );

	cin.get();
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2320959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320959</guid><dc:creator><![CDATA[nt2005]]></dc:creator><pubDate>Sat, 04 May 2013 17:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to WinHTTP Problem - hostName und objectName on Sat, 04 May 2013 17:06:07 GMT]]></title><description><![CDATA[<p>nt2005 schrieb:</p>
<blockquote>
<p>Jedoch funktioniert dies nicht.</p>
</blockquote>
<p>Du machst was falsch.</p>
<p>Wenn dir die Antwort nicht genügt, solltest du genau erklären, was &quot;funktioniert nicht&quot; heißt.</p>
<p>Abgesehen davon bist du im falschen Forum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320961</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Sat, 04 May 2013 17:06:07 GMT</pubDate></item><item><title><![CDATA[Reply to WinHTTP Problem - hostName und objectName on Sat, 04 May 2013 17:54:03 GMT]]></title><description><![CDATA[<p>Oh, das wusste ich nicht mit dem falschen Forum.</p>
<pre><code>ERROR_WINHTTP_CANNOT_CONNECT 12029 Returned if connection to the server failed.
</code></pre>
<p>Normalerweise erhalte ich den HTML-Code, bei funpic jedoch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320974</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320974</guid><dc:creator><![CDATA[nt2005]]></dc:creator><pubDate>Sat, 04 May 2013 17:54:03 GMT</pubDate></item><item><title><![CDATA[Reply to WinHTTP Problem - hostName und objectName on Sat, 04 May 2013 18:04:07 GMT]]></title><description><![CDATA[<p>Du versuchst eine https-Verbindung aufzubauen (INTERNET_DEFAULT_HTTPS_PORT, WINHTTP_FLAG_SECURE). Das Protokoll wird von <a href="http://www.google.de" rel="nofollow">www.google.de</a>, aber z.B. nicht von <a href="http://www.funpic.de" rel="nofollow">www.funpic.de</a> angeboten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320976</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 04 May 2013 18:04:07 GMT</pubDate></item><item><title><![CDATA[Reply to WinHTTP Problem - hostName und objectName on Sat, 04 May 2013 20:04:42 GMT]]></title><description><![CDATA[<p>Genau das war der Fehler. Vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2321000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2321000</guid><dc:creator><![CDATA[nt2005]]></dc:creator><pubDate>Sat, 04 May 2013 20:04:42 GMT</pubDate></item></channel></rss>