<?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[programm stürzt einfach ab :(]]></title><description><![CDATA[<p>hallo zusammen</p>
<p>ich bin eine Art Ftp Client am programmieren und jetzt ist das Problem, das mein Programm abstürzt nachdem ich versuche mich einzuloggen. leider kann ich mit den Debugg ausgaben nichts anfangen, hier mal die meldung des debuggers:</p>
<p>Eine Ausnahme (erste Chance) bei 0xcccccccc in NHWN.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xcccccccc.<br />
Unbehandelte Ausnahme bei 0xcccccccc in NHWN.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xcccccccc.</p>
<p>ich kann auch den quellcode posten. Die Verbindung zum FTP server und der ftp login funktionieren, das ist sicher. Ich poste mal was quellcode der WinMain:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
	TCHAR buffera[64];
	TCHAR bufferb[512];
	TCHAR bufferc[8];

    switch (message) 
    { 
    case WM_CREATE: 
        { 
			HINSTANCE hInstance = ((LPCREATESTRUCT)lParam)-&gt;hInstance;		// HINSTANCE festlegen

			ControlInterface.state = 1;				// Loginscreen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 50, 100, 20, hWnd, (HMENU)ID_LOGIN_USER , hInstance, NULL); 	//Username
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),_T(&quot;username&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP , 
						   50, 80, 100, 20, hWnd, (HMENU)ID_LOGIN_PWD , hInstance, NULL); 	//PWD
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_PWD),_T(&quot;password&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 110, 100, 20, hWnd, (HMENU)ID_LOGIN_CLASS , hInstance, NULL); 	//Class
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),_T(&quot;class&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Login&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_LOGIN, hInstance, NULL); 		//Button- Login erstellen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Abort&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_ABORT, hInstance, NULL); 		//Button-Abbrechen erstellen

			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_WORK, hInstance, NULL); 		//ListBoxA erstellen
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_UPLOAD, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_TODOFOR, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_PUBLISHER, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_LOG, hInstance, NULL); 

        } break; 

        case WM_SIZE: 
        { 
			ControlInterface.measure = lParam;

			switch(ControlInterface.state)
			{
				case 1:  
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_USER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_PWD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_CLASS),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_LOGIN),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),false);
					break;

				case 2:
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),true);

					int a= (LOWORD(ControlInterface.measure)-20)/5;
					int b= HIWORD(ControlInterface.measure)-20;
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),10,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),10+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),10+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),10+a+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),10+a+a+a+a,10,a,b,1);
					break;
			}

        } break;     

        case WM_PAINT: 
        { 
            PAINTSTRUCT ps; 
            HDC hDC = BeginPaint(hWnd, &amp;ps); 
            EndPaint(hWnd, &amp;ps); 
        } break; 

        case WM_COMMAND: 
        { 
			if( LOWORD(wParam) == ID_LOGIN_USER || ID_LOGIN_PWD || ID_LOGIN_CLASS )
			{
				switch( HIWORD(wParam))
				{
					case  EN_SETFOCUS:  	SetWindowText((HWND)lParam,NULL); break;
				}
			}

			if( LOWORD(wParam) == ID_LOGIN_LOGIN &amp;&amp; HIWORD(wParam) == BN_CLICKED )
			{

				 ControlInterface.hIntSession = InternetOpenW (_T(&quot;Microsoft Internet Explorer&quot;), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0) ;  // INet Session beginnen

				 if (ControlInterface.hIntSession == NULL)		// Fehler ?
				 {
						 MessageBox(hWnd,_T(&quot;hIntSession == NULL&quot;),0,0);
				 }

				 ControlInterface.hFtpSession = InternetConnectW (CI.hIntSession, ControlInterface.url,
											     INTERNET_DEFAULT_FTP_PORT,
											     ControlInterface.user,ControlInterface.pwd, INTERNET_SERVICE_FTP,                                    
											     INTERNET_FLAG_PASSIVE,                                    
											      0) ;    // FTP-Session beginnen

				 if (ControlInterface.hFtpSession == NULL )  // Fehler ?
				 {
					  MessageBox(hWnd,_T(&quot;hFtpSession == NULL&quot;),0,0);
				      InternetCloseHandle (ControlInterface.hIntSession) ;
				 }else
				 {
					 MessageBox(hWnd,_T(&quot;OK&quot;),0,0);
					 CI.state = 2;
				 }

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),CI.User,26) ;

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),CI.Class,3);

				 FtpSetCurrentDirectory(CI.hFtpSession, CI.Class);
				 FtpSetCurrentDirectory(CI.hFtpSession, CI.User);

				 lstrcat(buffera,CI.User);

				 wsprintf(CI.ProgDirectory,_T(&quot;C:\\NHWN\\&quot;));
				 lstrcat(bufferb,CI.ProgDirectory);

				 FtpGetFile(CI.hFtpSession, lstrcat(buffera,_T(&quot;.pro&quot;)),  lstrcat(bufferb, buffera),false,FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ,FTP_TRANSFER_TYPE_BINARY,NULL);
				 SendMessage(hWnd,WM_SIZE,CI.measure,CI.measure);

			}

        } break; 

        case WM_DESTROY: 
        { 
            PostQuitMessage(0); 
        } break; 
        default: 
            return DefWindowProc(hWnd, message, wParam, lParam); 
    } 
    return 0; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/196239/programm-stürzt-einfach-ab</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 16:53:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196239.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Oct 2007 09:52:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 09:52:43 GMT]]></title><description><![CDATA[<p>hallo zusammen</p>
<p>ich bin eine Art Ftp Client am programmieren und jetzt ist das Problem, das mein Programm abstürzt nachdem ich versuche mich einzuloggen. leider kann ich mit den Debugg ausgaben nichts anfangen, hier mal die meldung des debuggers:</p>
<p>Eine Ausnahme (erste Chance) bei 0xcccccccc in NHWN.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xcccccccc.<br />
Unbehandelte Ausnahme bei 0xcccccccc in NHWN.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xcccccccc.</p>
<p>ich kann auch den quellcode posten. Die Verbindung zum FTP server und der ftp login funktionieren, das ist sicher. Ich poste mal was quellcode der WinMain:</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
	TCHAR buffera[64];
	TCHAR bufferb[512];
	TCHAR bufferc[8];

    switch (message) 
    { 
    case WM_CREATE: 
        { 
			HINSTANCE hInstance = ((LPCREATESTRUCT)lParam)-&gt;hInstance;		// HINSTANCE festlegen

			ControlInterface.state = 1;				// Loginscreen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 50, 100, 20, hWnd, (HMENU)ID_LOGIN_USER , hInstance, NULL); 	//Username
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),_T(&quot;username&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP , 
						   50, 80, 100, 20, hWnd, (HMENU)ID_LOGIN_PWD , hInstance, NULL); 	//PWD
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_PWD),_T(&quot;password&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 110, 100, 20, hWnd, (HMENU)ID_LOGIN_CLASS , hInstance, NULL); 	//Class
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),_T(&quot;class&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Login&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_LOGIN, hInstance, NULL); 		//Button- Login erstellen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Abort&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_ABORT, hInstance, NULL); 		//Button-Abbrechen erstellen

			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_WORK, hInstance, NULL); 		//ListBoxA erstellen
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_UPLOAD, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_TODOFOR, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_PUBLISHER, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_LOG, hInstance, NULL); 

        } break; 

        case WM_SIZE: 
        { 
			ControlInterface.measure = lParam;

			switch(ControlInterface.state)
			{
				case 1:  
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_USER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_PWD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_CLASS),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_LOGIN),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),false);
					break;

				case 2:
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),true);

					int a= (LOWORD(ControlInterface.measure)-20)/5;
					int b= HIWORD(ControlInterface.measure)-20;
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),10,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),10+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),10+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),10+a+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),10+a+a+a+a,10,a,b,1);
					break;
			}

        } break;     

        case WM_PAINT: 
        { 
            PAINTSTRUCT ps; 
            HDC hDC = BeginPaint(hWnd, &amp;ps); 
            EndPaint(hWnd, &amp;ps); 
        } break; 

        case WM_COMMAND: 
        { 
			if( LOWORD(wParam) == ID_LOGIN_USER || ID_LOGIN_PWD || ID_LOGIN_CLASS )
			{
				switch( HIWORD(wParam))
				{
					case  EN_SETFOCUS:  	SetWindowText((HWND)lParam,NULL); break;
				}
			}

			if( LOWORD(wParam) == ID_LOGIN_LOGIN &amp;&amp; HIWORD(wParam) == BN_CLICKED )
			{

				 ControlInterface.hIntSession = InternetOpenW (_T(&quot;Microsoft Internet Explorer&quot;), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0) ;  // INet Session beginnen

				 if (ControlInterface.hIntSession == NULL)		// Fehler ?
				 {
						 MessageBox(hWnd,_T(&quot;hIntSession == NULL&quot;),0,0);
				 }

				 ControlInterface.hFtpSession = InternetConnectW (CI.hIntSession, ControlInterface.url,
											     INTERNET_DEFAULT_FTP_PORT,
											     ControlInterface.user,ControlInterface.pwd, INTERNET_SERVICE_FTP,                                    
											     INTERNET_FLAG_PASSIVE,                                    
											      0) ;    // FTP-Session beginnen

				 if (ControlInterface.hFtpSession == NULL )  // Fehler ?
				 {
					  MessageBox(hWnd,_T(&quot;hFtpSession == NULL&quot;),0,0);
				      InternetCloseHandle (ControlInterface.hIntSession) ;
				 }else
				 {
					 MessageBox(hWnd,_T(&quot;OK&quot;),0,0);
					 CI.state = 2;
				 }

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),CI.User,26) ;

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),CI.Class,3);

				 FtpSetCurrentDirectory(CI.hFtpSession, CI.Class);
				 FtpSetCurrentDirectory(CI.hFtpSession, CI.User);

				 lstrcat(buffera,CI.User);

				 wsprintf(CI.ProgDirectory,_T(&quot;C:\\NHWN\\&quot;));
				 lstrcat(bufferb,CI.ProgDirectory);

				 FtpGetFile(CI.hFtpSession, lstrcat(buffera,_T(&quot;.pro&quot;)),  lstrcat(bufferb, buffera),false,FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ,FTP_TRANSFER_TYPE_BINARY,NULL);
				 SendMessage(hWnd,WM_SIZE,CI.measure,CI.measure);

			}

        } break; 

        case WM_DESTROY: 
        { 
            PostQuitMessage(0); 
        } break; 
        default: 
            return DefWindowProc(hWnd, message, wParam, lParam); 
    } 
    return 0; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1392900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392900</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 09:52:43 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 09:54:05 GMT]]></title><description><![CDATA[<p>würde mich über eine Lösung des problems sehr freuen<br />
mfG<br />
noha</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392902</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 09:54:05 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 12:35:47 GMT]]></title><description><![CDATA[<p>Sagt der Debugger nicht in welcher Zeile? Oder springt beim Wurf in die entsprechende Zeile?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1392993</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1392993</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Sat, 27 Oct 2007 12:35:47 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 18:04:47 GMT]]></title><description><![CDATA[<p>nein, das ist unteranderem mein Prob.<br />
aber jetzt hab ich Get Last Error aufgerufen und die Parameter von FTPGetFile geändert, danach wird kein Wert mehr für GetLastError zurückgegeben aber das prog stürzt immer noch ab <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>-&gt; faszit, scheinbarer Fehler behoben, problematik besteht jedoch immer noch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393201</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393201</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 18:04:47 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 18:45:41 GMT]]></title><description><![CDATA[<p>Wir sollen jetzt dein Programm für dich debuggen!?!?</p>
<p>Nimm einfach so lange instruktionen raus,bis es nicht mehr crasht.<br />
Und grenze den Crash somit ein, bis du es hast</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393228</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Sat, 27 Oct 2007 18:45:41 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 19:26:09 GMT]]></title><description><![CDATA[<p>war doch ein guter Versuch euch das debuggen zu überlassen ^^</p>
<p>ne natürlich nicht: ich hab nur gedacht ich hätte irgendeinen &quot;richtigen&quot; Programmierfehler gemacht .... ( soweit man richtige Fehler machen kann <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> )</p>
<p>aber scheint so als wär das die einzige Möglichkeit <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> ich werd mich morgen dann mal drangeben, klingkt nach ner Menge Arbeit und bis jetzt hat immer noch ein Forumsuser meine meist dummen Fehler gefunden</p>
<p>mfG noha</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393252</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 19:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 19:56:46 GMT]]></title><description><![CDATA[<p>Ich würd es ja gerne debuggen, aber ich hab keinen Bock den Rest des Code jetzt selbst zu schreiben. Wenn dann müsstest du das Komplette Programm mal raufladen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393271</guid><dc:creator><![CDATA[Listing]]></dc:creator><pubDate>Sat, 27 Oct 2007 19:56:46 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 20:08:15 GMT]]></title><description><![CDATA[<p>eine variable die nicht explizit initialisiert wurde, wird im debug-build automatisch mit 0xcccccccc initialisiert. wenn das in deinem code passiert, sollte der debugger der auch anzeigen, wo du darauf zugreifst. kannst du den debugger bedienen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393278</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393278</guid><dc:creator><![CDATA[schniepel]]></dc:creator><pubDate>Sat, 27 Oct 2007 20:08:15 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 20:56:00 GMT]]></title><description><![CDATA[<p>das Programm ähnelt ( soll später mal sein ) einer Tauschbörse mit Profilfunktion</p>
<p>es sind noch ungenutzte Variablen drin ( auch der Knopf Abort ist ungenutzt )<br />
es handelt sich hierbei um mein erstes prog mit wininet</p>
<p>man sieht auch die Stelle, an der ich mit FtpGetFile die parameter geändert hab. Die Datei wird erfolgreich gedownloaded ,wie gewünscht und dann nachdem die Listboxen angezeigt werden und die letzte MessageBox weggeklickt wurde - stürzt es ab</p>
<p>der freenet ftp server dient nur als testobjekt</p>
<pre><code class="language-cpp">// NHWN.cpp : Definiert den Einstiegspunkt für die Anwendung.
//
#include &quot;stdafx.h&quot;
#include &quot;Header.h&quot;

static struct
{
	int state;			// 1 = Loginscreen, 2= online,

	LPARAM measure;    // Maße des Fensters

	TCHAR ProgDirectory[512];  // hier befindet sich das Programm

	// Logindaten für FTP Server
	TCHAR user[25] ;			// Benutzername
	TCHAR pwd[25] ;				// Password
	TCHAR url[64] ;				// FTP-Server

	HINTERNET       hIntSession, hFtpSession, hFind, hFile ;     // Handles für den Internetzugriff
	WIN32_FIND_DATA data ;						// gefundene Datei

	// LoginDaten für Account
	TCHAR User[25];
	TCHAR Pwd[25];
	TCHAR Class[3];

}ControlInterface;

#define CI ControlInterface

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR szCmdLine, int iCmdShow) 
{ 
    WNDCLASSEX wc; 
    wc.cbSize            = sizeof (WNDCLASSEX); 
    wc.cbClsExtra        = 0; 
    wc.cbWndExtra        = 0; 
    wc.hInstance        = hInstance; 
    wc.lpszClassName    = _T(&quot;NHWN&quot;); 
    wc.lpfnWndProc        = WndProc; 
    wc.style            = CS_HREDRAW | CS_VREDRAW; 
    wc.hIcon            = LoadIcon(NULL, IDI_APPLICATION); 
    wc.hIconSm            = wc.hIcon; 
    wc.hCursor            = LoadCursor (NULL, IDC_ARROW); 
    wc.lpszMenuName        = NULL;                 
    wc.hbrBackground    = (HBRUSH)GetStockObject(WHITE_BRUSH); 

    if (RegisterClassEx(&amp;wc) == 0) 
    { 
        MessageBox (NULL, _T(&quot;Fehler beim registrieren der Fensterklasse!&quot;), _T(&quot;Norsensoft HomeWork Network Client&quot;), MB_OK | MB_ICONERROR); 
        return 0; 
    } 

    HWND hWnd = CreateWindowEx(0, _T(&quot;NHWN&quot;), _T(&quot;Norsensoft HomeWork Network Client&quot;), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 900, 200, NULL, NULL, hInstance, NULL); 

    if (hWnd == NULL) 
    { 
        MessageBox(NULL, _T(&quot;Fenster konnte nicht erstellt werden!&quot;), _T(&quot;Norsensoft FTP Client&quot;), MB_OK | MB_ICONERROR); 
        return 0; 
    } 

	lstrcat(CI.user , _T(&quot;noha_391&quot;));			// Benutzername
	lstrcat(CI.pwd , _T(&quot;PASSWORT&quot;));				// Password
	lstrcat(CI.url , _T(&quot;people-ftp.freenet.de&quot;));// FTP-Server

    ShowWindow(hWnd, iCmdShow); 
    UpdateWindow(hWnd); 

    MSG msg; 
    while (GetMessage (&amp;msg, NULL, 0, 0)) 
    { 
		IsDialogMessage(hWnd,&amp;msg);
        //TranslateMessage(&amp;msg); 
        //DispatchMessage(&amp;msg); 
    } 
    return static_cast&lt;int&gt;(msg.wParam); 
} 

//----------------------------------------------------------------------------------------------

void ERROr( HWND hWnd )
{
	TCHAR bufferc[156];
	DWORD error = GetLastError();
					wsprintf( bufferc,_T(&quot;%d&quot;),error);
				 MessageBox(hWnd,bufferc,0,0);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
	TCHAR buffera[64];
	TCHAR bufferb[512];
	TCHAR bufferc[8];

    switch (message) 
    { 
    case WM_CREATE: 
        { 
			HINSTANCE hInstance = ((LPCREATESTRUCT)lParam)-&gt;hInstance;		// HINSTANCE festlegen

			ControlInterface.state = 1;				// Loginscreen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 50, 100, 20, hWnd, (HMENU)ID_LOGIN_USER , hInstance, NULL); 	//Username
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),_T(&quot;username&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP , 
						   50, 80, 100, 20, hWnd, (HMENU)ID_LOGIN_PWD , hInstance, NULL); 	//PWD
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_PWD),_T(&quot;password&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL | WS_TABSTOP, 
						   50, 110, 100, 20, hWnd, (HMENU)ID_LOGIN_CLASS , hInstance, NULL); 	//Class
			SetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),_T(&quot;class&quot;));			// Text einsetzen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Login&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_LOGIN, hInstance, NULL); 		//Button- Login erstellen

			CreateWindowExW(0, _T(&quot;button&quot;), _T(&quot;Abort&quot;), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP, 
							200, 110, 150, 20, hWnd, (HMENU)ID_LOGIN_ABORT, hInstance, NULL); 		//Button-Abbrechen erstellen

			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_WORK, hInstance, NULL); 		//ListBoxA erstellen
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_UPLOAD, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_TODOFOR, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_PUBLISHER, hInstance, NULL); 
			CreateWindowEx(0, _T(&quot;listbox&quot;), NULL, WS_CHILD | ES_LEFT | LBS_NOTIFY | WS_BORDER, 0, 0, 0, 0, hWnd, (HMENU)ID_LISTBOX_LOG, hInstance, NULL); 

        } break; 

        case WM_SIZE: 
        { 
			ControlInterface.measure = lParam;

			switch(ControlInterface.state)
			{
				case 1:  
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_USER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_PWD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_CLASS),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_LOGIN),true);
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),false);
					break;

				case 2:
					ShowWindow(GetDlgItem(hWnd,ID_LOGIN_ABORT),false);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),true);
					ShowWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),true);

					int a= (LOWORD(ControlInterface.measure)-20)/5;
					int b= HIWORD(ControlInterface.measure)-20;
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_WORK),10,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_UPLOAD),10+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_TODOFOR),10+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_PUBLISHER),10+a+a+a,10,a,b,1);
					MoveWindow(GetDlgItem(hWnd,ID_LISTBOX_LOG),10+a+a+a+a,10,a,b,1);
					break;
			}

        } break;     

        case WM_PAINT: 
        { 
            PAINTSTRUCT ps; 
            HDC hDC = BeginPaint(hWnd, &amp;ps); 
            EndPaint(hWnd, &amp;ps); 
        } break; 

        case WM_COMMAND: 
		{ 
			if( LOWORD(wParam) == ID_LOGIN_USER || ID_LOGIN_PWD || ID_LOGIN_CLASS )
			{
				switch( HIWORD(wParam))
				{
					case  EN_SETFOCUS:  	SetWindowText((HWND)lParam,NULL); break;
				}
			}

			if( LOWORD(wParam) == ID_LOGIN_LOGIN &amp;&amp; HIWORD(wParam) == BN_CLICKED )
			{

				 ControlInterface.hIntSession = InternetOpenW (_T(&quot;Microsoft Internet Explorer&quot;), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0) ;  // INet Session beginnen

				 if (ControlInterface.hIntSession == NULL)		// Fehler ?
				 {
						 MessageBox(hWnd,_T(&quot;hIntSession == NULL&quot;),0,0);
				 }

				 ControlInterface.hFtpSession = InternetConnectW (CI.hIntSession, ControlInterface.url,
											     INTERNET_DEFAULT_FTP_PORT,
											     ControlInterface.user,ControlInterface.pwd, INTERNET_SERVICE_FTP,                                    
											     INTERNET_FLAG_PASSIVE,                                    
											      0) ;    // FTP-Session beginnen

				 if (ControlInterface.hFtpSession == NULL )  // Fehler ?
				 {
					  MessageBox(hWnd,_T(&quot;hFtpSession == NULL&quot;),0,0);
				      InternetCloseHandle (ControlInterface.hIntSession) ;
				 }else
				 {
					 MessageBox(hWnd,_T(&quot;OK&quot;),0,0);
					 CI.state = 2;
				 }

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_USER),CI.User,26) ;

				 GetWindowText(GetDlgItem(hWnd,ID_LOGIN_CLASS),CI.Class,3);

				 ERROr(hWnd);

				 FtpSetCurrentDirectory(CI.hFtpSession, CI.Class);
				 FtpSetCurrentDirectory(CI.hFtpSession, CI.User);

				 ERROr(hWnd);
				 lstrcat(buffera,CI.User);

				 ERROr(hWnd);
				 wsprintf(CI.ProgDirectory,_T(&quot;C:\\NHWN\\&quot;));
				 lstrcat(bufferb,CI.ProgDirectory);

				 ERROr(hWnd);

				 //FtpGetFileW(CI.hFtpSession, lstrcat(buffera,_T(&quot;.pro&quot;)),  lstrcat(bufferb, buffera),false,FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ,FTP_TRANSFER_TYPE_BINARY,NULL);
				 FtpGetFileW(CI.hFtpSession, _T(&quot;norman.pro&quot;),  _T(&quot;C:\\NHWN\\norman.pro&quot;),false,FILE_SHARE_DELETE | FILE_SHARE_WRITE | FILE_SHARE_READ,FTP_TRANSFER_TYPE_BINARY,NULL);
				 ERROr(hWnd);
				 SendMessage(hWnd,WM_SIZE,CI.measure,CI.measure);

				 ERROr(hWnd);
			}

        } break; 

        case WM_DESTROY: 
        { 
            PostQuitMessage(0); 
        } break; 
        default: 
            return DefWindowProc(hWnd, message, wParam, lParam); 
    } 
    return 0; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1393315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393315</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 20:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 20:57:48 GMT]]></title><description><![CDATA[<p>achja:</p>
<p>debugger richtig bedienen -&gt; negativ</p>
<p>er zeigte mir bis jetzt immer wo der fehler lag ( linie markieren ),aber diesmal nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
benutze visual c++ express</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393316</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393316</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sat, 27 Oct 2007 20:57:48 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sat, 27 Oct 2007 21:07:33 GMT]]></title><description><![CDATA[<p>du schreibst bestimmt mit diesem ganzen sprintf und strcat gefrickel über eine buffergrenze weg. wenn du es mit dem debugger ned hinbekommst, dann debug doch selbst wie Listing schon meinte. kommentier halt alles aus und geh dann zeile für zeile durch, bis du weißt an welcher zeile es liegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393326</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393326</guid><dc:creator><![CDATA[tenchou]]></dc:creator><pubDate>Sat, 27 Oct 2007 21:07:33 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sun, 28 Oct 2007 10:09:35 GMT]]></title><description><![CDATA[<p>ich bin jetzt wie beschrieben verfahren, und habe den Fehler lokalisiert:</p>
<p>lstrcat(bufferb,CI.ProgDirectory); ist der Übeltäter</p>
<p>leider weis ich nicht warum <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> bufferb ist auf keinen fall zu klein, da ich ihn auf 1024 ausgeweitet habe. Ich habe die Anweisung auch schon durch:</p>
<p>wsprintf(bufferb,_T(&quot;%s&quot;),CI.ProgDirectory);</p>
<p>ersetzt aber erfolgslos</p>
<p>kann mir jemand den Fehler erklären ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393486</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393486</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Sun, 28 Oct 2007 10:09:35 GMT</pubDate></item><item><title><![CDATA[Reply to programm stürzt einfach ab :( on Sun, 28 Oct 2007 10:14:30 GMT]]></title><description><![CDATA[<p>das wsprintf(bufferb,_T(\\&quot;%s\\&quot;),CI.ProgDirectory); funktioniert doch, ( hatte noch nen haltepunkt davor gesetzt, jedoch bekomm ich in der vorletzten message box error 5, aber das programm läuft, werd mich jetzt noch damit auseinandersetzen.</p>
<p>Vielen dank an alle die mir geholfen haben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393487</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393487</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Sun, 28 Oct 2007 10:14:30 GMT</pubDate></item></channel></rss>