<?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[Variablen übergeben]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe folgendes Prob:</p>
<p>Ich möchte die Audio und Videogeräte meines Rechners anzeigen lassen.<br />
Die Prozedur funktioniert auch. Doch wie kann ich die Variablen übergeben.<br />
Und an welcher Posistion im Quelltext muß ich diese Funktion einfügen.<br />
Ich möchte das Sie sofort bei Programmstart ausgeführt wird. Die Geräte sollen in eine Listbox angezeigt werden. Ich habe Sie bisher in der</p>
<pre><code>CMainFrame::CMainFrame()
{
	// ZU ERLEDIGEN: Hier Code zur Member-Initialisierung einfügen
	m_ListBox.Create(
		            WS_CHILD | WS_VISIBLE | WS_BORDER,
					CRect(50,50,250,50),this,1);

	// Declare variables.
    HRESULT hr;
    IWMEncoder2* pEncoder;
    IWMEncSourcePluginInfoManager* pSrcPlugMgr;
    IWMEncDeviceControlPluginInfoManager* pDCPlugMgr;
    IWMEncPluginInfo* pPlugInfo;
    int i;
    int j;
    long lCount;
    long lResrcCount;
    CComBSTR sScheme;
    CComBSTR sName;
    VARIANT_BOOL bResources;

    // Initialize the COM library and retrieve a pointer
    // to an IWMEncoder interface.
    hr = CoInitialize(NULL);
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_WMEncoder,
            NULL,
            CLSCTX_INPROC_SERVER,
            IID_IWMEncoder2,
            (void**) &amp;pEncoder);
    }

    // Retrieve source and device plug-in info manager objects from IWMEncoder.
    if ( SUCCEEDED( hr ) )
    {
        hr = pEncoder-&gt;get_SourcePluginInfoManager(&amp;pSrcPlugMgr);
    }
    if ( SUCCEEDED( hr ) )
    {
        hr = pEncoder-&gt;get_DeviceControlPluginInfoManager(&amp;pDCPlugMgr);
    }

    // Loop through all the audio and video devices on the system.
    if ( SUCCEEDED( hr ) )
    {
        hr = pSrcPlugMgr-&gt;get_Count(&amp;lCount);
    }
    for (i = 0; i &lt; lCount; i++)
    {
        // Set the IWMEncPluginInfo object to the current plug-in.
        if ( SUCCEEDED( hr ) )
        {
            hr = pSrcPlugMgr-&gt;Item(i, &amp;pPlugInfo);
        }

        // Find the plug-ins that support resources.
        if ( SUCCEEDED( hr ) )
        {
            hr = pPlugInfo-&gt;get_SchemeType(&amp;sScheme);
        }
        if (_wcsicmp(sScheme, CComBSTR(&quot;DEVICE&quot;))==0)
        {
            // Find the devices.
            if ( SUCCEEDED( hr ) )
            {
                hr = pPlugInfo-&gt;get_Resources(&amp;bResources);
            }
            if (bResources==VARIANT_TRUE)
            {
                // Loop through the resources in the current plug-in.
                if ( SUCCEEDED( hr ) )
                {
                    hr = pPlugInfo-&gt;get_Count(&amp;lResrcCount);
                }
                for (j = 0; j &lt; lResrcCount; j++)
                {
                    // Display the name of the plug-in.
                    if ( SUCCEEDED( hr ) )
                    {
                        hr = pPlugInfo-&gt;Item(j, &amp;sName);
                    }
                    wprintf(CComBSTR(&quot;%s\n&quot;), sName);//HIER STEHT IN DER VARIABLEN sName DER NAME DESJEWEILIGEN GERÄTES
		MessageBox(&quot;Test&quot;,&quot;Info&quot;,MB_OK);
                }
            }
        }
    }

    // This section shows how to enumerate digital devices such as DV cameras and VTRs.

    // Loop through the connected digital devices on the system such as DV cameras and VTRs.
    if ( SUCCEEDED( hr ) )
    {
        hr = pDCPlugMgr-&gt;get_Count(&amp;lCount);
    }
    for (i = 0; i &lt; lCount; i++)
    {
        // Set the IWMEncPluginInfo object to the current plug-in.
        if ( SUCCEEDED( hr ) )
        {
            hr = pDCPlugMgr-&gt;Item(i, &amp;pPlugInfo);
        }

        // Find the digital devices.
        if ( SUCCEEDED( hr ) )
        {
            hr = pPlugInfo-&gt;get_SchemeType(&amp;sScheme);
        }
        if (_wcsicmp(sScheme, CComBSTR(&quot;DEVICECONTROL&quot;))==0)
        {
            if ( SUCCEEDED( hr ) )
            {
                hr = pPlugInfo-&gt;get_Count(&amp;lResrcCount);
            }
            // Loop through the resources in the current plug-in.
            for (j = 0; j &lt; lResrcCount; j++)
            {
                // Display the name of the plug-in.
                if ( SUCCEEDED( hr ) )
                {
                    hr = pPlugInfo-&gt;Item(j, &amp;sName);
                }
             }
        }
    }

}
</code></pre>
<p>Wie kann ich nun die ermittelten Werte in einer Listbox speichern, damit ich diese Auswählen kann?<br />
Und wo gehört die Funktion hin. Ich glaub die CMaineFrame() ist falsch.</p>
<p>Gruß</p>
<p>Trikor <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/53592/variablen-übergeben</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 13:44:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/53592.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 30 Oct 2003 14:40:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Variablen übergeben on Thu, 30 Oct 2003 14:41:21 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe folgendes Prob:</p>
<p>Ich möchte die Audio und Videogeräte meines Rechners anzeigen lassen.<br />
Die Prozedur funktioniert auch. Doch wie kann ich die Variablen übergeben.<br />
Und an welcher Posistion im Quelltext muß ich diese Funktion einfügen.<br />
Ich möchte das Sie sofort bei Programmstart ausgeführt wird. Die Geräte sollen in eine Listbox angezeigt werden. Ich habe Sie bisher in der</p>
<pre><code>CMainFrame::CMainFrame()
{
	// ZU ERLEDIGEN: Hier Code zur Member-Initialisierung einfügen
	m_ListBox.Create(
		            WS_CHILD | WS_VISIBLE | WS_BORDER,
					CRect(50,50,250,50),this,1);

	// Declare variables.
    HRESULT hr;
    IWMEncoder2* pEncoder;
    IWMEncSourcePluginInfoManager* pSrcPlugMgr;
    IWMEncDeviceControlPluginInfoManager* pDCPlugMgr;
    IWMEncPluginInfo* pPlugInfo;
    int i;
    int j;
    long lCount;
    long lResrcCount;
    CComBSTR sScheme;
    CComBSTR sName;
    VARIANT_BOOL bResources;

    // Initialize the COM library and retrieve a pointer
    // to an IWMEncoder interface.
    hr = CoInitialize(NULL);
    if ( SUCCEEDED( hr ) )
    {
        hr = CoCreateInstance(CLSID_WMEncoder,
            NULL,
            CLSCTX_INPROC_SERVER,
            IID_IWMEncoder2,
            (void**) &amp;pEncoder);
    }

    // Retrieve source and device plug-in info manager objects from IWMEncoder.
    if ( SUCCEEDED( hr ) )
    {
        hr = pEncoder-&gt;get_SourcePluginInfoManager(&amp;pSrcPlugMgr);
    }
    if ( SUCCEEDED( hr ) )
    {
        hr = pEncoder-&gt;get_DeviceControlPluginInfoManager(&amp;pDCPlugMgr);
    }

    // Loop through all the audio and video devices on the system.
    if ( SUCCEEDED( hr ) )
    {
        hr = pSrcPlugMgr-&gt;get_Count(&amp;lCount);
    }
    for (i = 0; i &lt; lCount; i++)
    {
        // Set the IWMEncPluginInfo object to the current plug-in.
        if ( SUCCEEDED( hr ) )
        {
            hr = pSrcPlugMgr-&gt;Item(i, &amp;pPlugInfo);
        }

        // Find the plug-ins that support resources.
        if ( SUCCEEDED( hr ) )
        {
            hr = pPlugInfo-&gt;get_SchemeType(&amp;sScheme);
        }
        if (_wcsicmp(sScheme, CComBSTR(&quot;DEVICE&quot;))==0)
        {
            // Find the devices.
            if ( SUCCEEDED( hr ) )
            {
                hr = pPlugInfo-&gt;get_Resources(&amp;bResources);
            }
            if (bResources==VARIANT_TRUE)
            {
                // Loop through the resources in the current plug-in.
                if ( SUCCEEDED( hr ) )
                {
                    hr = pPlugInfo-&gt;get_Count(&amp;lResrcCount);
                }
                for (j = 0; j &lt; lResrcCount; j++)
                {
                    // Display the name of the plug-in.
                    if ( SUCCEEDED( hr ) )
                    {
                        hr = pPlugInfo-&gt;Item(j, &amp;sName);
                    }
                    wprintf(CComBSTR(&quot;%s\n&quot;), sName);//HIER STEHT IN DER VARIABLEN sName DER NAME DESJEWEILIGEN GERÄTES
		MessageBox(&quot;Test&quot;,&quot;Info&quot;,MB_OK);
                }
            }
        }
    }

    // This section shows how to enumerate digital devices such as DV cameras and VTRs.

    // Loop through the connected digital devices on the system such as DV cameras and VTRs.
    if ( SUCCEEDED( hr ) )
    {
        hr = pDCPlugMgr-&gt;get_Count(&amp;lCount);
    }
    for (i = 0; i &lt; lCount; i++)
    {
        // Set the IWMEncPluginInfo object to the current plug-in.
        if ( SUCCEEDED( hr ) )
        {
            hr = pDCPlugMgr-&gt;Item(i, &amp;pPlugInfo);
        }

        // Find the digital devices.
        if ( SUCCEEDED( hr ) )
        {
            hr = pPlugInfo-&gt;get_SchemeType(&amp;sScheme);
        }
        if (_wcsicmp(sScheme, CComBSTR(&quot;DEVICECONTROL&quot;))==0)
        {
            if ( SUCCEEDED( hr ) )
            {
                hr = pPlugInfo-&gt;get_Count(&amp;lResrcCount);
            }
            // Loop through the resources in the current plug-in.
            for (j = 0; j &lt; lResrcCount; j++)
            {
                // Display the name of the plug-in.
                if ( SUCCEEDED( hr ) )
                {
                    hr = pPlugInfo-&gt;Item(j, &amp;sName);
                }
             }
        }
    }

}
</code></pre>
<p>Wie kann ich nun die ermittelten Werte in einer Listbox speichern, damit ich diese Auswählen kann?<br />
Und wo gehört die Funktion hin. Ich glaub die CMaineFrame() ist falsch.</p>
<p>Gruß</p>
<p>Trikor <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/382789</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/382789</guid><dc:creator><![CDATA[Trikor]]></dc:creator><pubDate>Thu, 30 Oct 2003 14:41:21 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen übergeben on Thu, 30 Oct 2003 16:45:20 GMT]]></title><description><![CDATA[<p>weiß nicht ob du hier richtig bist, aber<br />
erstmal würde ich zwischen einlesen und anzeigen unterscheiden.</p>
<p>Zweitens: wie &quot;gleich&quot; sollen denn die Daten angezeigt werden.</p>
<p>Eine GUI die erstmal alles mögliche macht bevor sie sich zeigt ist eigentlich nicht vom Anwender<br />
nachvollziebar.<br />
Okay ist nicht mein Ding.</p>
<p>Ein günstiger Punkt zum einlesen wäre in MFC virtual BOOL CWinApp::InitInstance();<br />
Mußt die Daten dann wohl in einen Container packen. Map vector,list oder so<br />
Wenn das ListCtrl initalisiert wird kannste sie entweder direkt um kopieren<br />
oder mit LVS_ OWNERDATA die Daten vom Container auslesen und anzeigen. Hier zu gibt es<br />
noch ne ganze Reihe anderer alternativen.</p>
<p>Ein anderer günstiger Punkt,wenn auch ungleich schwerer, wäre nach der Initalisierung des ListCtrl/Views mit LVS_ OWNERDATA und setitemcount(1) das erste Element einzulesen und dann alle weitern. Ist nur eine Überlegung.</p>
<p>Das Einfügen wird geht mit: int MyList.InsertItem( const LVITEM* pItem );</p>
]]></description><link>https://www.c-plusplus.net/forum/post/382868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/382868</guid><dc:creator><![CDATA[idefix]]></dc:creator><pubDate>Thu, 30 Oct 2003 16:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen übergeben on Mon, 03 Nov 2003 09:41:08 GMT]]></title><description><![CDATA[<p>Hast recht, InitInstance() bietet sich dafür an. Aber wie und wo definiere ich den Container??? Die Daten müssen ja von der App nach Dlg.<br />
Hab noch nie mit Containern gearbeitet. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/385448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/385448</guid><dc:creator><![CDATA[Trikor]]></dc:creator><pubDate>Mon, 03 Nov 2003 09:41:08 GMT</pubDate></item><item><title><![CDATA[Reply to Variablen übergeben on Mon, 03 Nov 2003 11:37:47 GMT]]></title><description><![CDATA[<p>Zum Beispiel ein vector aus der STL<br />
[url]<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39470&amp;highlight=vector" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic.php?t=39470&amp;highlight=vector</a><br />
[/url]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/385551</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/385551</guid><dc:creator><![CDATA[idefix]]></dc:creator><pubDate>Mon, 03 Nov 2003 11:37:47 GMT</pubDate></item></channel></rss>