<?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[DDV und DDX]]></title><description><![CDATA[<p>Hallo,</p>
<p>irgendwie schaffe ich es nicht eine eigene DDV zu schreiben.<br />
Vielleicht kann mir ja jemand von euch helfen.</p>
<p>ich weiß einfach nicht, wo ich diese ddv hinschreiben soll.</p>
<p>void CAbschlussDlg::DoDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog::DoDataExchange(pDX);<br />
//{{AFX_DATA_MAP(CAbschlussDlg)<br />
DDX_Text(pDX, IDC_EINGABE, m_eingabe);<br />
DDV_MaxChars(pDX, m_eingabe, 3);<br />
//}}AFX_DATA_MAP</p>
<pre><code>DDV_test(pDX,m_eingabe,3);
	{	
		int length;
		length=m_eingabe.GetLength();
		if(length&lt;2)
		{
			AfxMessageBox(&quot;zu kurz&quot;);
		}
	}
</code></pre>
<p>}</p>
<p>ich habe sie hier reingeschrieben bekomme allerdings die fehlermeldung DDV_test unbekannt.<br />
Wo steht eigentlich die Implementierung der standard DDVs?</p>
<p>Vielen Dank</p>
<p>Harry</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75662/ddv-und-ddx</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 10:27:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75662.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jun 2004 21:42:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DDV und DDX on Wed, 02 Jun 2004 21:42:50 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>irgendwie schaffe ich es nicht eine eigene DDV zu schreiben.<br />
Vielleicht kann mir ja jemand von euch helfen.</p>
<p>ich weiß einfach nicht, wo ich diese ddv hinschreiben soll.</p>
<p>void CAbschlussDlg::DoDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog::DoDataExchange(pDX);<br />
//{{AFX_DATA_MAP(CAbschlussDlg)<br />
DDX_Text(pDX, IDC_EINGABE, m_eingabe);<br />
DDV_MaxChars(pDX, m_eingabe, 3);<br />
//}}AFX_DATA_MAP</p>
<pre><code>DDV_test(pDX,m_eingabe,3);
	{	
		int length;
		length=m_eingabe.GetLength();
		if(length&lt;2)
		{
			AfxMessageBox(&quot;zu kurz&quot;);
		}
	}
</code></pre>
<p>}</p>
<p>ich habe sie hier reingeschrieben bekomme allerdings die fehlermeldung DDV_test unbekannt.<br />
Wo steht eigentlich die Implementierung der standard DDVs?</p>
<p>Vielen Dank</p>
<p>Harry</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532022</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532022</guid><dc:creator><![CDATA[jusuf12]]></dc:creator><pubDate>Wed, 02 Jun 2004 21:42:50 GMT</pubDate></item><item><title><![CDATA[Reply to DDV und DDX on Wed, 02 Jun 2004 22:26:47 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void AFXAPI DDV_MaxChars(CDataExchange* pDX, CString const&amp; value, int nChars)
{
	ASSERT(nChars &gt;= 1);        // allow them something
	if (pDX-&gt;m_bSaveAndValidate &amp;&amp; value.GetLength() &gt; nChars)
	{
		TCHAR szT[32];
		wsprintf(szT, _T(&quot;%d&quot;), nChars);
		CString prompt;
		AfxFormatString1(prompt, AFX_IDP_PARSE_STRING_SIZE, szT);
		AfxMessageBox(prompt, MB_ICONEXCLAMATION, AFX_IDP_PARSE_STRING_SIZE);
		prompt.Empty(); // exception prep
		pDX-&gt;Fail();
	}
	else if (pDX-&gt;m_idLastControl != 0 &amp;&amp; pDX-&gt;m_bEditLastControl)
	{
	  HWND hWndLastControl;
	  pDX-&gt;m_pDlgWnd-&gt;GetDlgItem(pDX-&gt;m_idLastControl, &amp;hWndLastControl);
		// limit the control max-chars automatically
		::SendMessage(hWndLastControl, EM_LIMITTEXT, nChars, 0);
	}
}
</code></pre>
<p>Das ist DDV_MaxChars. Nix weiter als eine globale Funktion, die definiert wird, bevor sie verwendet wird. Ganz simpel.</p>
<p>Was du machst, kann so nicht gehen, dass müsste wohl folgendermaßen aussehen:</p>
<pre><code class="language-cpp">void AFXAPI DDV_test(CDataExchange* pDX, CString value, int nLength);
{    
    int length;
    length=m_value.GetLength();
    if(length&lt;2)
    {
        AfxMessageBox(&quot;zu kurz&quot;);
    }
} 

void CAbschlussDlg::DoDataExchange(CDataExchange* pDX) 
{ 
CDialog::DoDataExchange(pDX); 
//{{AFX_DATA_MAP(CAbschlussDlg) 
DDX_Text(pDX, IDC_EINGABE, m_eingabe); 
DDV_MaxChars(pDX, m_eingabe, 3); 
//}}AFX_DATA_MAP 
DDV_test(pDX,m_eingabe,3);
</code></pre>
<p>Allerdings frage ich mich, wozu der dritte Parameter gut ist, du verwendest ihn nirgends.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532054</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Wed, 02 Jun 2004 22:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to DDV und DDX on Wed, 02 Jun 2004 22:41:28 GMT]]></title><description><![CDATA[<p>Vielen Dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> ,</p>
<p>du hast meinen Schlaf gerettet.<br />
Jetzt funktioniert es!!! Dass das eine globale Funktion sein könnte, daran habe ich irgendwie gar nicht mehr gedacht. Gehirnwindungskrampf!!!</p>
<p>Den dritte Parameter hab ich jetzt noch mit eingebaut.<br />
Das war nur eine Testversion.</p>
<p>cu</p>
<p>Harry</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532067</guid><dc:creator><![CDATA[jusuf12]]></dc:creator><pubDate>Wed, 02 Jun 2004 22:41:28 GMT</pubDate></item><item><title><![CDATA[Reply to DDV und DDX on Thu, 03 Jun 2004 05:15:27 GMT]]></title><description><![CDATA[<p>DDV_test war ja auch bei dir unbekannt da du oben DDV_text hattest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/532088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/532088</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 03 Jun 2004 05:15:27 GMT</pubDate></item></channel></rss>