<?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[ActiveX Control mit Button]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich habe mit Visual Studio ein ActiveX Control erzeugt.</p>
<p>In diesem ActiveX Control möchte ich ein Button plazieren ohne das ActiveX selber als Buton zu definieren.</p>
<p>Kann mir vielleicht jemand helfen und sagen wie das geht?</p>
<p>Danke schon mal im vorraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146645/activex-control-mit-button</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 21:02:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146645.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 May 2006 17:25:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ActiveX Control mit Button on Tue, 09 May 2006 17:26:55 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich habe mit Visual Studio ein ActiveX Control erzeugt.</p>
<p>In diesem ActiveX Control möchte ich ein Button plazieren ohne das ActiveX selber als Buton zu definieren.</p>
<p>Kann mir vielleicht jemand helfen und sagen wie das geht?</p>
<p>Danke schon mal im vorraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054322</guid><dc:creator><![CDATA[souso20]]></dc:creator><pubDate>Tue, 09 May 2006 17:26:55 GMT</pubDate></item><item><title><![CDATA[Reply to ActiveX Control mit Button on Tue, 09 May 2006 22:06:25 GMT]]></title><description><![CDATA[<p>Erzeuge doch den Button als Child-Fenster des ActiveX-Controls.</p>
<p>Ich schreib mal in etwa wie ich das meine:</p>
<p>Header:</p>
<pre><code class="language-cpp">class CMyActiveX : public COleControl
{
   // Mein ActiveXControl
protected:
   CButton  m_wndMyButton;

	//{{AFX_MSG(CMyActiveX)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};
</code></pre>
<p>CPP-Datei:</p>
<pre><code class="language-cpp">BEGIN_MESSAGE_MAP(CMyActiveX, COleControl)
	//{{AFX_MSG_MAP(CMyActiveX)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

int CMy\1::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (COleControl::OnCreate(lpCreateStruct) == -1)
		return -1;

	if ( !m_wndMyButton.Create( _T(&quot;Mein Button&quot;), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, CRect(0,0,0,0), this, 1000 ) )
		return -1;

	return 0;
}
</code></pre>
<p>Die Größe des Buttons kannst du z.B. in OnSize dem ActiveX-Control anpassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054516</guid><dc:creator><![CDATA[tvdog]]></dc:creator><pubDate>Tue, 09 May 2006 22:06:25 GMT</pubDate></item><item><title><![CDATA[Reply to ActiveX Control mit Button on Wed, 10 May 2006 07:48:07 GMT]]></title><description><![CDATA[<p>Danke für Deine Antwort.</p>
<p>Ich habe das ganze mal eingebaut und bin mit dem Debugger darüber gelaufen.</p>
<p>Also der Debugger läuft sauber darüber, aber im ActiveX wird mir leider kein Button angezeigt.</p>
<p>Muss ich diesen noch sichtbar machen oder etwas ähnliches?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054611</guid><dc:creator><![CDATA[souso20]]></dc:creator><pubDate>Wed, 10 May 2006 07:48:07 GMT</pubDate></item><item><title><![CDATA[Reply to ActiveX Control mit Button on Wed, 10 May 2006 08:34:44 GMT]]></title><description><![CDATA[<p>Danke für das Beispiel.</p>
<p>Hat funktioniert.</p>
<p>Wie kann ich mich mit dem ActiveX am Button anmelden um ein OnClick Ereigniss zu bekommen?</p>
<p>Wäre es denkbar ein vorhandenes Fenster so auch im ActiveX als Child darzustellen oder zu erzeugen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054630</guid><dc:creator><![CDATA[souso20]]></dc:creator><pubDate>Wed, 10 May 2006 08:34:44 GMT</pubDate></item><item><title><![CDATA[Reply to ActiveX Control mit Button on Wed, 10 May 2006 21:27:19 GMT]]></title><description><![CDATA[<p>Die Nachrichten des Buttons werden genauso bearbeitet wie z.B. bei einem Button im Dialog. Du kannst also die BN_CLICKED - Botschaft wie folgt im ActiveX-Control abfangen:</p>
<pre><code class="language-cpp">class CMyActiveX : public COleControl
{
   // Mein ActiveXControl
protected:
   CButton  m_wndMyButton;

    //{{AFX_MSG(CMyActiveX)
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	  afx_msg void OnButton1();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CMyActiveX, COleControl)
	// ...
	ON_BN_CLICKED(1000, OnButton1)
	// ...
END_MESSAGE_MAP()

// Die 1000 sollte besser durch ein Define ersetzt werden 

void CMy\1::OnButton1() 
{
	// TODO: Code für die Behandlungsroutine der Steuerelement-Benachrichtigung hier einfügen

}
</code></pre>
<p>Das sieht also genauso aus wie der ClassWizzard - Code aus einem Dialog. Ich lasse die Behandlungsroutine vom Wizzard bei einem Testdialog erzeugen und kopiere dann die entsprechenden Stellen einfach in meien CMyActiveX - Klasse.</p>
<p>Es lässt sich natürlich jedes beliebige Fenster als Child-Fenster in das ActiveX-Control aufnehmen (Das als Child-Fenster geeignet ist). Die Erzeugung erfolgt ähnlich wie beim Erstellen des Buttons.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1055227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1055227</guid><dc:creator><![CDATA[tvdog]]></dc:creator><pubDate>Wed, 10 May 2006 21:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to ActiveX Control mit Button on Thu, 11 May 2006 07:11:16 GMT]]></title><description><![CDATA[<p>Vielen Dank für Deine ausführliche Hilfe.</p>
<p>Du hast mir echt weitergeholfen.</p>
<p>Bis denne</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1055300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1055300</guid><dc:creator><![CDATA[souso20]]></dc:creator><pubDate>Thu, 11 May 2006 07:11:16 GMT</pubDate></item></channel></rss>