<?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[MessageBox mit if Anweisung]]></title><description><![CDATA[<p>Hallo,<br />
ich habe wieder mal ein Programm das Einwandfrei funktioniert, doch manchmal ergibt der ein Nenner in diesem Programm Null. Sehr schön, aber jedes Kind weiß durch Null darf nicht dividiert werden. Ich hab vesucht, falls das geschieht (N = 0) eine AfxMessageBox erscheinen zu lassen, if (m_Dn = 0), aber es passiert nix, wenn Dn eine beliebige Zahl wir, egal ob null oder hunderttausend.</p>
<p>Wie mach ich das?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/67555/messagebox-mit-if-anweisung</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 09:46:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/67555.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Mar 2004 16:35:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 16:35:37 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich habe wieder mal ein Programm das Einwandfrei funktioniert, doch manchmal ergibt der ein Nenner in diesem Programm Null. Sehr schön, aber jedes Kind weiß durch Null darf nicht dividiert werden. Ich hab vesucht, falls das geschieht (N = 0) eine AfxMessageBox erscheinen zu lassen, if (m_Dn = 0), aber es passiert nix, wenn Dn eine beliebige Zahl wir, egal ob null oder hunderttausend.</p>
<p>Wie mach ich das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/476702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476702</guid><dc:creator><![CDATA[Flocki]]></dc:creator><pubDate>Tue, 09 Mar 2004 16:35:37 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 16:44:24 GMT]]></title><description><![CDATA[<pre><code>// Schnittpunk_GOLDDlg.cpp : Implementierungsdatei
//

#include &quot;stdafx.h&quot;
#include &quot;Schnittpunk_GOLD.h&quot;
#include &quot;Schnittpunk_GOLDDlg.h&quot;

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

/////////////////////////////////////////////////////////////////////////////
// CSchnittpunk_GOLDDlg Dialogfeld

CSchnittpunk_GOLDDlg::CSchnittpunk_GOLDDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CSchnittpunk_GOLDDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSchnittpunk_GOLDDlg)
	m_A1 = 0.0f;
	m_A2 = 0.0f;
	m_B1 = 0.0f;
	m_B2 = 0.0f;
	m_C1 = 0.0f;
	m_C2 = 0.0f;
	m_Dn = 0.0f;
	m_Dx = 0.0f;
	m_Dy = 0.0f;
	m_X = 0.0f;
	//}}AFX_DATA_INIT
	// Beachten Sie, dass LoadIcon unter Win32 keinen nachfolgenden DestroyIcon-Aufruf benötigt
	m_hIcon = AfxGetApp()-&gt;LoadIcon(IDR_MAINFRAME);
}

void CSchnittpunk_GOLDDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSchnittpunk_GOLDDlg)
	DDX_Text(pDX, IDC_A1, m_A1);
	DDX_Text(pDX, IDC_A2, m_A2);
	DDX_Text(pDX, IDC_B1, m_B1);
	DDX_Text(pDX, IDC_B2, m_B2);
	DDX_Text(pDX, IDC_C1, m_C1);
	DDX_Text(pDX, IDC_C2, m_C2);
	DDX_Text(pDX, IDC_Dn, m_Dn);
	DDX_Text(pDX, IDC_Dx, m_Dx);
	DDX_Text(pDX, IDC_Dy, m_Dy);
	DDX_Text(pDX, IDC_X, m_X);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CSchnittpunk_GOLDDlg, CDialog)
	//{{AFX_MSG_MAP(CSchnittpunk_GOLDDlg)
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_DnB, OnDnB)
	ON_BN_CLICKED(IDC_DxB, OnDxB)
	ON_BN_CLICKED(IDC_DyB, OnDyB)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSchnittpunk_GOLDDlg Nachrichten-Handler

BOOL CSchnittpunk_GOLDDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Symbol für dieses Dialogfeld festlegen. Wird automatisch erledigt
	//  wenn das Hauptfenster der Anwendung kein Dialogfeld ist
	SetIcon(m_hIcon, TRUE);			// Großes Symbol verwenden
	SetIcon(m_hIcon, FALSE);		// Kleines Symbol verwenden

	// ZU ERLEDIGEN: Hier zusätzliche Initialisierung einfügen

	return TRUE;  // Geben Sie TRUE zurück, außer ein Steuerelement soll den Fokus erhalten
}

// Wollen Sie Ihrem Dialogfeld eine Schaltfläche &quot;Minimieren&quot; hinzufügen, benötigen Sie 
//  den nachstehenden Code, um das Symbol zu zeichnen. Für MFC-Anwendungen, die das 
//  Dokument/Ansicht-Modell verwenden, wird dies automatisch für Sie erledigt.

void CSchnittpunk_GOLDDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // Gerätekontext für Zeichnen

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Symbol in Client-Rechteck zentrieren
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&amp;rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Symbol zeichnen
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// Die Systemaufrufe fragen den Cursorform ab, die angezeigt werden soll, während der Benutzer
//  das zum Symbol verkleinerte Fenster mit der Maus zieht.
HCURSOR CSchnittpunk_GOLDDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CSchnittpunk_GOLDDlg::OnDnB() 
{
UpdateData (TRUE);
CString strErgebnis;
strErgebnis.Format(&quot;%f&quot;, m_B2 * m_A1 - m_A2 * m_B1);
SetDlgItemText(IDC_Dn, strErgebnis);
}

void CSchnittpunk_GOLDDlg::OnDxB() 
{
UpdateData (TRUE);
CString strErgebnis;
strErgebnis.Format(&quot;%f&quot;, m_B2 * m_C1 - m_C2 * m_B1);
SetDlgItemText(IDC_Dx, strErgebnis);	
}

void CSchnittpunk_GOLDDlg::OnDyB() 
{
UpdateData (TRUE);
CString strErgebnis;
strErgebnis.Format(&quot;%f&quot;, m_C2 * m_A1 - m_C1 * m_A2);
SetDlgItemText(IDC_Dy, strErgebnis);
}

void CSchnittpunk_GOLDDlg::OnButton2() 
{
UpdateData (TRUE);
CString strErgebnis;
strErgebnis.Format(&quot;%f&quot;, m_Dx / m_Dn);
SetDlgItemText(IDC_X, strErgebnis);	
strErgebnis.Format(&quot;%f&quot;, m_Dy / m_Dn);
SetDlgItemText(IDC_Y, strErgebnis);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/476703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476703</guid><dc:creator><![CDATA[Flocki]]></dc:creator><pubDate>Tue, 09 Mar 2004 16:44:24 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 16:47:05 GMT]]></title><description><![CDATA[<p>Also das Problem liegt da ganz unten beim letzten void. wo Dx durch Dn diviedert wird:</p>
<pre><code>void CSchnittpunk_GOLDDlg::OnButton2() 
{
UpdateData (TRUE);
CString strErgebnis;
strErgebnis.Format(&quot;%f&quot;, m_Dx / m_Dn);
SetDlgItemText(IDC_X, strErgebnis);	
strErgebnis.Format(&quot;%f&quot;, m_Dy / m_Dn);
SetDlgItemText(IDC_Y, strErgebnis);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/476705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476705</guid><dc:creator><![CDATA[Flocki]]></dc:creator><pubDate>Tue, 09 Mar 2004 16:47:05 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 17:02:28 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>also wenn du wirklich, wie du schreibst mit</p>
<p>Flocki schrieb:</p>
<blockquote>
<p>if (m_Dn = 0),</p>
</blockquote>
<p>eine MessageBox erzeugen willst, dann darfst du dich nicht wundern, wenn keine angezeigt wird. Das &quot;=&quot; ist der Zuweisungsoperator, und das &quot;==&quot; ist der Vergleichsoperator. Wenn das nur ein Schreibfehler war, dann erkläre noch einmal, wo und wie du das eingebaut hast. Der gezeigte Code enthält zumindest kein einziges if(m_Dn == 0)...also, einbauen, und dann sehen wir weiter</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/476722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476722</guid><dc:creator><![CDATA[Probe-Nutzer]]></dc:creator><pubDate>Tue, 09 Mar 2004 17:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 19:24:48 GMT]]></title><description><![CDATA[<p>Da keins funktioniert hat, hab ichs später aus dem Quekkcde genommmen!<br />
Aber danke du hatest Recht es lag daran das ich 2 = brauch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/476802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476802</guid><dc:creator><![CDATA[Flocki]]></dc:creator><pubDate>Tue, 09 Mar 2004 19:24:48 GMT</pubDate></item><item><title><![CDATA[Reply to MessageBox mit if Anweisung on Tue, 09 Mar 2004 21:48:18 GMT]]></title><description><![CDATA[<p>du kannst exevptions in deinem programm verwenden, die sind immer gut</p>
<p>dann brachst auch kein if oder so extra machen und dein prog muesste schneller sein ( wenn mans nachmessen könnte <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>
<pre><code>try
{

// meine berechnungen. wenn hier ein fehler gemacht wird dann wird catch ausgeführt
}
catch(...)   // ist zwar net so sauber, aber es reicht. (...) fängt alles auf
{

::MessageBox(&quot;Nicht durch NULL teilen !!!!&quot;);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/476909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/476909</guid><dc:creator><![CDATA[fletscher]]></dc:creator><pubDate>Tue, 09 Mar 2004 21:48:18 GMT</pubDate></item></channel></rss>