<?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[CreateThread() &amp;lt;-- Parameter übergeben]]></title><description><![CDATA[<p>hallo!</p>
<p>ich rufe eine funktion von mir als thread auf - dieser funktion sollen nun<br />
aber mehrere paramter übergeben werden...</p>
<p>wie kann ich das mit CreateThread() realisieren??</p>
<p>danke euch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/152632/createthread-lt-parameter-übergeben</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 16:19:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152632.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Jul 2006 23:19:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateThread() &amp;lt;-- Parameter übergeben on Fri, 07 Jul 2006 23:19:50 GMT]]></title><description><![CDATA[<p>hallo!</p>
<p>ich rufe eine funktion von mir als thread auf - dieser funktion sollen nun<br />
aber mehrere paramter übergeben werden...</p>
<p>wie kann ich das mit CreateThread() realisieren??</p>
<p>danke euch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1093654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1093654</guid><dc:creator><![CDATA[Babelduos Geist]]></dc:creator><pubDate>Fri, 07 Jul 2006 23:19:50 GMT</pubDate></item><item><title><![CDATA[Reply to CreateThread() &amp;lt;-- Parameter übergeben on Fri, 07 Jul 2006 23:23:28 GMT]]></title><description><![CDATA[<p>gib dem thread einen pointer auf eine struct, die alle variablen enthält...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1093656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1093656</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Fri, 07 Jul 2006 23:23:28 GMT</pubDate></item><item><title><![CDATA[Reply to CreateThread() &amp;lt;-- Parameter übergeben on Sat, 08 Jul 2006 01:20:26 GMT]]></title><description><![CDATA[<p>hmm ich habe versucht als parameter der thread-funktion nen pointer auf nen<br />
struct zu machen aber da kam nen fehler von wegen konnte den paramater<br />
von CreateThread() nicht in struct koverieren.</p>
<p>wie muss ich das denn aufrufen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1093670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1093670</guid><dc:creator><![CDATA[Babelduos Geist]]></dc:creator><pubDate>Sat, 08 Jul 2006 01:20:26 GMT</pubDate></item><item><title><![CDATA[Reply to CreateThread() &amp;lt;-- Parameter übergeben on Sat, 08 Jul 2006 05:28:12 GMT]]></title><description><![CDATA[<p>MSDN schrieb:</p>
<blockquote>
<p>CreateThread</p>
<p>Creates a thread to execute within the virtual address space of the calling process.</p>
<p>To create a thread that runs in the virtual address space of another process, use the CreateRemoteThread function.</p>
<p>HANDLE WINAPI CreateThread(<br />
LPSECURITY_ATTRIBUTES lpThreadAttributes,<br />
SIZE_T dwStackSize,<br />
LPTHREAD_START_ROUTINE lpStartAddress,<br />
LPVOID lpParameter,<br />
DWORD dwCreationFlags,<br />
LPDWORD lpThreadId<br />
);</p>
<p>Parameters</p>
<p>lpThreadAttributes<br />
[in] A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpThreadAttributes is NULL, the handle cannot be inherited.</p>
<p>The lpSecurityDescriptor member of the structure specifies a security descriptor for the new thread. If lpThreadAttributes is NULL, the thread gets a default security descriptor. The ACLs in the default security descriptor for a thread come from the primary token of the creator.</p>
<p>Windows XP/2000/NT: The ACLs in the default security descriptor for a thread come from the primary or impersonation token of the creator. This behavior changed with Windows XP SP2 and Windows Server 2003.</p>
<p>dwStackSize<br />
[in] The initial size of the stack, in bytes. The system rounds this value to the nearest page. If this parameter is zero, the new thread uses the default size for the executable. For more information, see Thread Stack Size.<br />
lpStartAddress<br />
[in] A pointer to the application-defined function to be executed by the thread and represents the starting address of the thread. For more information on the thread function, see ThreadProc.<br />
<strong>lpParameter<br />
[in] A pointer to a variable to be passed to the thread.</strong><br />
dwCreationFlags<br />
[in] The flags that control the creation of the thread. If the CREATE_SUSPENDED flag is specified, the thread is created in a suspended state, and will not run until the ResumeThread function is called. If this value is zero, the thread runs immediately after creation.</p>
</blockquote>
<p>Dort musst du die Adresse rein schreiben und nicht hinter dem Funktionsnamen, oder wie auch immer du das versucht hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1093680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1093680</guid><dc:creator><![CDATA[FachmannFürThreads]]></dc:creator><pubDate>Sat, 08 Jul 2006 05:28:12 GMT</pubDate></item><item><title><![CDATA[Reply to CreateThread() &amp;lt;-- Parameter übergeben on Sat, 08 Jul 2006 07:56:48 GMT]]></title><description><![CDATA[<p>Babelduos Geist schrieb:</p>
<blockquote>
<p>hmm ich habe versucht als parameter der thread-funktion nen pointer auf nen<br />
struct zu machen aber da kam nen fehler von wegen konnte den paramater<br />
von CreateThread() nicht in struct koverieren.</p>
</blockquote>
<p>Du kanst an CreateThread jeden Zeiger übergeben. In der Thread Funktion musst Du halt den Zeiger zurückcasten.</p>
<p>MYStruct *p = static_cast&lt;MYStruct *&gt;(lpParameter);</p>
<p>BTW: Nimm _beginthreadex, wenn Du auch die CRT verwendest!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1093706</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1093706</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 08 Jul 2006 07:56:48 GMT</pubDate></item></channel></rss>