<?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[*gelöst* MFC Funktionen in statischer Bibliothek]]></title><description><![CDATA[<p>Hallo<br />
Ich bin noch recht neu hier und auch noch nicht so fit in Bezug auf MFC. Hoffe aber ihr habt etwas Geduld mit mir und könnt mir eventuell helfen.</p>
<p>Ich habe mir eine &quot;lib&quot; geschrieben, die mir die CFileDialog Funktion bereitstellt, und die ich in eine DLL einbinde.<br />
Hatte vorher die CFileDialog Funktion in einer Konsolenanwendung. Da lief alles super. Seit dem sie aber jetzt in der &quot;lib&quot; steckt ist der Wurm drin.<br />
Wenn ich die Funktion aufrufe, öffnet sich zwar der Dialog, aber die &quot;Filter-Strings&quot; werden nicht korrekt dargestellt. Es erscheint nur eine Ansammlung &quot;wilder Zeichen&quot;. Wie bekomme ich es jetzt hin, dass meine Filter Strings korrekt dargestellt werden? Was mache ich falsch?</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;mfc.h&quot;
#include &quot;afxwin.h&quot;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

using namespace std;

namespace Edl
{
    CString OpenEdl::OpenEdlFile()
    {

	CString path;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
	  // TODO: change error code to suit your needs
	  cerr &lt;&lt; _T(&quot;Fatal Error: MFC initialization failed&quot;) &lt;&lt; endl;

	}
	else
	{
	  CFileDialog fileDlg(TRUE, &quot;edl&quot;, &quot;EDL&quot;, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, &quot;EDL Files (*.edl)|*.edl||&quot;);

			if(fileDlg.DoModal ()==IDOK)
			{
				path = fileDlg.GetPathName();
			}
		}

	return path;
	}

}
</code></pre>
<p>Kann leider immo kein Bild dazu posten. Ich reiche es aber nach.<br />
Vielen Dank schon mal.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185850/gelöst-mfc-funktionen-in-statischer-bibliothek</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 14:01:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185850.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Jul 2007 08:48:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 11:14:44 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich bin noch recht neu hier und auch noch nicht so fit in Bezug auf MFC. Hoffe aber ihr habt etwas Geduld mit mir und könnt mir eventuell helfen.</p>
<p>Ich habe mir eine &quot;lib&quot; geschrieben, die mir die CFileDialog Funktion bereitstellt, und die ich in eine DLL einbinde.<br />
Hatte vorher die CFileDialog Funktion in einer Konsolenanwendung. Da lief alles super. Seit dem sie aber jetzt in der &quot;lib&quot; steckt ist der Wurm drin.<br />
Wenn ich die Funktion aufrufe, öffnet sich zwar der Dialog, aber die &quot;Filter-Strings&quot; werden nicht korrekt dargestellt. Es erscheint nur eine Ansammlung &quot;wilder Zeichen&quot;. Wie bekomme ich es jetzt hin, dass meine Filter Strings korrekt dargestellt werden? Was mache ich falsch?</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;mfc.h&quot;
#include &quot;afxwin.h&quot;

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

using namespace std;

namespace Edl
{
    CString OpenEdl::OpenEdlFile()
    {

	CString path;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
	  // TODO: change error code to suit your needs
	  cerr &lt;&lt; _T(&quot;Fatal Error: MFC initialization failed&quot;) &lt;&lt; endl;

	}
	else
	{
	  CFileDialog fileDlg(TRUE, &quot;edl&quot;, &quot;EDL&quot;, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, &quot;EDL Files (*.edl)|*.edl||&quot;);

			if(fileDlg.DoModal ()==IDOK)
			{
				path = fileDlg.GetPathName();
			}
		}

	return path;
	}

}
</code></pre>
<p>Kann leider immo kein Bild dazu posten. Ich reiche es aber nach.<br />
Vielen Dank schon mal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316628</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316628</guid><dc:creator><![CDATA[MRTcharlie]]></dc:creator><pubDate>Mon, 02 Jul 2007 11:14:44 GMT</pubDate></item><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 09:03:47 GMT]]></title><description><![CDATA[<p>Haben beide Projekt (EXE und LIB) identische Einstellungen für die MFC. Also wird in beiden Fällen die MFC als DL-Version oder als statische LIB gebunden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316637</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316637</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 02 Jul 2007 09:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 09:56:34 GMT]]></title><description><![CDATA[<p>Ich habe den Code 1:1 übertragen und der Dialog öffnet sich ja auch. Das Problem ist die Formatierung im &quot;Dateiname&quot; und &quot;Dateityp&quot; Feld.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316686</guid><dc:creator><![CDATA[MRTcharlie]]></dc:creator><pubDate>Mon, 02 Jul 2007 09:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 11:11:02 GMT]]></title><description><![CDATA[<p>*link entfernt*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316721</guid><dc:creator><![CDATA[MRTcharlie]]></dc:creator><pubDate>Mon, 02 Jul 2007 11:11:02 GMT</pubDate></item><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 10:38:46 GMT]]></title><description><![CDATA[<p>Kann es sein, das die Unicode Einstelungen Deines projektes unterscheidlich sind und Du einige Warnungen ignoriert hast?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316731</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 02 Jul 2007 10:38:46 GMT</pubDate></item><item><title><![CDATA[Reply to *gelöst* MFC Funktionen in statischer Bibliothek on Mon, 02 Jul 2007 11:09:02 GMT]]></title><description><![CDATA[<p>*Gelöst*<br />
Vielen Dank für den Hinweis. Ich hatte tatsächlich &quot;/D &quot;_UNICODE&quot; und<br />
/D &quot;UNICODE&quot; in den Compileroptionen für die &quot;lib&quot; vergessen. Für die dll war es eingetragen. Jetzt wird alles richtig angezeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316762</guid><dc:creator><![CDATA[MRTcharlie]]></dc:creator><pubDate>Mon, 02 Jul 2007 11:09:02 GMT</pubDate></item></channel></rss>