<?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 hängt sich am Schluss auf warum?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab mir eine kleine Anwendung geschrieben um meine unzip.dll zu testen, um nicht immer die DLL in mein Testanwendungsverzeichniss zu kopieren, dachte ich mir ich rufe sie per LoadLibrary auf, hierfür setzte ich <strong>#define TEST</strong>. Seltsammerweise hängt sich meine Anwendung am Schluß auf wenn ich die DLL per LoadLibrary lade und ausführe. Wenn ich die DLL ins Verzeichniss meiner Testanwendung kopiere wird die Testanwendung ohne Crash beendet. Damit ihr mich nicht falsch versteht, die unzip.dll entpackt immer die Datei, hier scheins nicht zu Crashen, die Testanwendung hat wohl einen fehler. Also hier mal der Code:</p>
<pre><code class="language-cpp">#define TEST

int main(int argc, char *argv[]) {

	int				back = 0;
	config_t				*conf;
#ifdef TEST
	HMODULE			hDLL;
	typedef FARPROC WINAPI 	DOUNZIP(config_t *conf);
	DOUNZIP			*pDOUNZIP;
#endif	
	conf = malloc(sizeof(config_t));
	memset(conf, 0, sizeof(config_t));
	conf-&gt;opt_do_list = 0;
	conf-&gt;opt_do_extract = 1;
	conf-&gt;opt_do_extract_withoutpath = 0;
	conf-&gt;opt_overwrite = 0;
	conf-&gt;opt_outputmethod = 1;
	strcpy(conf-&gt;opt_extradirectory, &quot;C:\\TEMP\\1&quot;);
	strcpy(conf-&gt;opt_password, &quot;&quot;);
	strcpy(conf-&gt;opt_zipfilename, &quot;pack.zip&quot;);
	strcpy(conf-&gt;opt_filename_to_extract, &quot;&quot;);

#ifdef TEST
	hDLL = LoadLibrary(&quot;..\\..\\build_DLL\\Release\\unzip.dll&quot;);
	if(hDLL){
		pDOUNZIP = (DOUNZIP *)GetProcAddress(hDLL, &quot;DoUnzip&quot;);
		if(pDOUNZIP){
			pDOUNZIP(conf);
		}else{
			printf(&quot;GetProcAddress failed!&quot;);
		}
		FreeLibrary(hDLL);
	}else{
		printf(&quot;LoadLibrary failed!&quot;);
	}
#else
	DoUnzip(conf);
#endif
	free(conf);
	getchar();
	return(back);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/230291/programm-hängt-sich-am-schluss-auf-warum</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 01:04:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/230291.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Dec 2008 15:04:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm hängt sich am Schluss auf warum? on Tue, 23 Dec 2008 15:04:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich hab mir eine kleine Anwendung geschrieben um meine unzip.dll zu testen, um nicht immer die DLL in mein Testanwendungsverzeichniss zu kopieren, dachte ich mir ich rufe sie per LoadLibrary auf, hierfür setzte ich <strong>#define TEST</strong>. Seltsammerweise hängt sich meine Anwendung am Schluß auf wenn ich die DLL per LoadLibrary lade und ausführe. Wenn ich die DLL ins Verzeichniss meiner Testanwendung kopiere wird die Testanwendung ohne Crash beendet. Damit ihr mich nicht falsch versteht, die unzip.dll entpackt immer die Datei, hier scheins nicht zu Crashen, die Testanwendung hat wohl einen fehler. Also hier mal der Code:</p>
<pre><code class="language-cpp">#define TEST

int main(int argc, char *argv[]) {

	int				back = 0;
	config_t				*conf;
#ifdef TEST
	HMODULE			hDLL;
	typedef FARPROC WINAPI 	DOUNZIP(config_t *conf);
	DOUNZIP			*pDOUNZIP;
#endif	
	conf = malloc(sizeof(config_t));
	memset(conf, 0, sizeof(config_t));
	conf-&gt;opt_do_list = 0;
	conf-&gt;opt_do_extract = 1;
	conf-&gt;opt_do_extract_withoutpath = 0;
	conf-&gt;opt_overwrite = 0;
	conf-&gt;opt_outputmethod = 1;
	strcpy(conf-&gt;opt_extradirectory, &quot;C:\\TEMP\\1&quot;);
	strcpy(conf-&gt;opt_password, &quot;&quot;);
	strcpy(conf-&gt;opt_zipfilename, &quot;pack.zip&quot;);
	strcpy(conf-&gt;opt_filename_to_extract, &quot;&quot;);

#ifdef TEST
	hDLL = LoadLibrary(&quot;..\\..\\build_DLL\\Release\\unzip.dll&quot;);
	if(hDLL){
		pDOUNZIP = (DOUNZIP *)GetProcAddress(hDLL, &quot;DoUnzip&quot;);
		if(pDOUNZIP){
			pDOUNZIP(conf);
		}else{
			printf(&quot;GetProcAddress failed!&quot;);
		}
		FreeLibrary(hDLL);
	}else{
		printf(&quot;LoadLibrary failed!&quot;);
	}
#else
	DoUnzip(conf);
#endif
	free(conf);
	getchar();
	return(back);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1634692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1634692</guid><dc:creator><![CDATA[verwirrt]]></dc:creator><pubDate>Tue, 23 Dec 2008 15:04:51 GMT</pubDate></item><item><title><![CDATA[Reply to Programm hängt sich am Schluss auf warum? on Tue, 23 Dec 2008 18:46:59 GMT]]></title><description><![CDATA[<p>Und was sagt der Debugger?<br />
Wo steht Dein Programm?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1634803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1634803</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 23 Dec 2008 18:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to Programm hängt sich am Schluss auf warum? on Tue, 23 Dec 2008 19:05:42 GMT]]></title><description><![CDATA[<p>Vielleicht solltest Du eine Tatse drücken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1634809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1634809</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 23 Dec 2008 19:05:42 GMT</pubDate></item><item><title><![CDATA[Reply to Programm hängt sich am Schluss auf warum? on Tue, 23 Dec 2008 23:07:27 GMT]]></title><description><![CDATA[<p>habe diese Zeile geändert</p>
<pre><code class="language-cpp">typedef FARPROC WINAPI 	DOUNZIP(config_t *conf);
</code></pre>
<p>sieht jetzt so aus</p>
<pre><code class="language-cpp">typedef FARPROC	DOUNZIP(config_t *conf);
</code></pre>
<p>jetzt gehts ohne Hänger</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1634908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1634908</guid><dc:creator><![CDATA[verwirrt]]></dc:creator><pubDate>Tue, 23 Dec 2008 23:07:27 GMT</pubDate></item></channel></rss>