<?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[item data casten]]></title><description><![CDATA[<pre><code class="language-cpp">static char orginalDaten[100];
strcpy(orginalDaten,&quot;hm, dreckig&quot;);
	mii2.cbSize=sizeof(MENUITEMINFO);
				mii2.fMask =   MIIM_ID |MIIM_FTYPE|MIIM_DATA;
				mii2.fType=MF_OWNERDRAW;
				mii2.wID=23;
				mii2.dwItemData=(char)orginalDaten;
InsertMenuItem(hMenu, 2,1,&amp;mii2);

case WM_DRAWITEM: 
 static LPDRAWITEMSTRUCT str=(LPDRAWITEMSTRUCT) lParam;
if(str-&gt;itemID)
	 {
		 MENUITEMINFO *buf;
		 GetMenuItemInfo(hMenu,str-&gt;itemID,true,buf);
 char *zeiger=(char*)&amp;str-&gt;itemData;
		 MessageBox(0,zeiger,0,0);
}
</code></pre>
<p>Die MessageBox gibt nicht den Text &quot;hm, dreckig&quot; aus. Wieso nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/98632/item-data-casten</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 20:41:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/98632.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Jan 2005 21:55:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 21:55:21 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">static char orginalDaten[100];
strcpy(orginalDaten,&quot;hm, dreckig&quot;);
	mii2.cbSize=sizeof(MENUITEMINFO);
				mii2.fMask =   MIIM_ID |MIIM_FTYPE|MIIM_DATA;
				mii2.fType=MF_OWNERDRAW;
				mii2.wID=23;
				mii2.dwItemData=(char)orginalDaten;
InsertMenuItem(hMenu, 2,1,&amp;mii2);

case WM_DRAWITEM: 
 static LPDRAWITEMSTRUCT str=(LPDRAWITEMSTRUCT) lParam;
if(str-&gt;itemID)
	 {
		 MENUITEMINFO *buf;
		 GetMenuItemInfo(hMenu,str-&gt;itemID,true,buf);
 char *zeiger=(char*)&amp;str-&gt;itemData;
		 MessageBox(0,zeiger,0,0);
}
</code></pre>
<p>Die MessageBox gibt nicht den Text &quot;hm, dreckig&quot; aus. Wieso nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701930</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Thu, 20 Jan 2005 21:55:21 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:00:51 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">MENUITEMINFO *buf;
</code></pre>
</blockquote>
<p>Nicht initialisiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701938</guid><dc:creator><![CDATA[Dirty Coder]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:00:51 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:09:01 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">MENUITEMINFO buf;
		 buf.cbSize=sizeof(MENUITEMINFO);
		 GetMenuItemInfo(hMenu,str-&gt;itemID,false,&amp;buf);
		 char *zeiger=(char*)&amp;str-&gt;itemData;
		 MessageBox(0,zeiger,0,0);
</code></pre>
<p>Funktioniert immer noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701946</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701946</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:13:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">MENUITEMINFO buf;
		 buf.cbSize=sizeof(MENUITEMINFO);
		 GetMenuItemInfo(hMenu,str-&gt;itemID,false,&amp;buf);
  		 char *zeiger=(char*)buf.dwItemData;
		 MessageBox(0,zeiger,0,0);
</code></pre>
<p>So, und es geht immer noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701948</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:13:29 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:14:24 GMT]]></title><description><![CDATA[<p>Wofür machst du eigentlich den GetMenuItemInfo Aufruf wenn du dann die Informationen gar nicht benutzt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701952</guid><dc:creator><![CDATA[hmmmmmm?]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:14:24 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:15:11 GMT]]></title><description><![CDATA[<p>Ich weiß, deswegen habe ich nochmal neuen Beitrag dazu geschrieben. <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/701953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701953</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:15:11 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:16:17 GMT]]></title><description><![CDATA[<p>GetMenuString ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701954</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701954</guid><dc:creator><![CDATA[Homer.]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:16:17 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Thu, 20 Jan 2005 22:17:49 GMT]]></title><description><![CDATA[<p>.... und wenn es eine Structur wäre...grml</p>
]]></description><link>https://www.c-plusplus.net/forum/post/701956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/701956</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Thu, 20 Jan 2005 22:17:49 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Fri, 21 Jan 2005 05:36:31 GMT]]></title><description><![CDATA[<blockquote>
<p>To retrieve a menu item of type MFT_STRING, first find the size of the string by setting the dwTypeData member of MENUITEMINFO to NULL and then calling GetMenuItemInfo. The value of cch+1 is the size needed. Then allocate a buffer of this size, place the pointer to the buffer in dwTypeData, increment cch by one, and then call GetMenuItemInfo once again to fill the buffer with the string.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/702018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/702018</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 21 Jan 2005 05:36:31 GMT</pubDate></item><item><title><![CDATA[Reply to item data casten on Fri, 21 Jan 2005 13:02:38 GMT]]></title><description><![CDATA[<p>...Ich habe ein Objekt das alle Möglichen Sachen enthält.<br />
Das Objekt wird in mii2.dwItemData abgelegt bzw. konvertiert und soll bei der WM_DRAWITEM message mitgelifert werden. -&gt; Da nützt mir ..._STRING nicht viel...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/702368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/702368</guid><dc:creator><![CDATA[item data]]></dc:creator><pubDate>Fri, 21 Jan 2005 13:02:38 GMT</pubDate></item></channel></rss>