<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bitmap in Toolbar button in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4567757#M13212</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The COM API is intended for use even from external applications. As you have already found, the "SetBitmaps" method only accepts full path. This is&amp;nbsp;&lt;SPAN&gt;mentioned in the AutoCAD ActiveX API documentation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2013 11:46:15 GMT</pubDate>
    <dc:creator>Balaji_Ram</dc:creator>
    <dc:date>2013-10-28T11:46:15Z</dc:date>
    <item>
      <title>Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4513713#M13207</link>
      <description>&lt;P&gt;I've checked every post i could find in this forum. Some of them helped, but now I'm stucked.&lt;/P&gt;&lt;P&gt;I'm creating a Toolbar, and adding some buttons, everthing works fine. Then I'm setting the bitmaps for these buttons. And the bitmaps are in the resource, the are embeded with the plugin. When i launch the AutoCad from the Visual Studio the buttons has the bitmaps as icons, just as I expected. But runnig a release version of the plugin I get only the "Cloud with questin mark" icon for my buttons. I've got that during the debug AutoCad was geting the bitmaps in the path were all the sources and files are, and is set as working directory. Here is a piece of my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void defineToolbar()
{
	//CAcModuleResourceOverride resOverride;
	AutoCAD::IAcadApplication *pAcad;
	AutoCAD::IAcadMenuGroups *pMenuGroups;
	AutoCAD::IAcadMenuGroup *pMenuGroup;
	AutoCAD::IAcadToolbars *pToolbars;
	AutoCAD::IAcadToolbar *pToolbar;
	AutoCAD::IAcadToolbarItem *pToolbarItem;
	
	HRESULT hr = NOERROR;
	LPUNKNOWN pUnk = NULL;
	LPDISPATCH pAcadDisp = acedGetIDispatch(TRUE);
	hr = pAcadDisp-&amp;gt;QueryInterface(AutoCAD::IID_IAcadApplication, (void**)&amp;amp;pAcad);
	pAcadDisp-&amp;gt;Release();
	if (FAILED(hr))
		return;
	
	pAcad-&amp;gt;put_Visible(true);
	pAcad-&amp;gt;get_MenuGroups(&amp;amp;pMenuGroups);
	pAcad-&amp;gt;Release();
	VARIANT index;
	VariantInit(&amp;amp;index);
	V_VT(&amp;amp;index) = VT_I4;
	V_I4(&amp;amp;index) = 0;
	VARIANT flyoutButton;
	VariantInit(&amp;amp;flyoutButton);
	V_VT(&amp;amp;flyoutButton) = VT_BOOL;
	V_BOOL(&amp;amp;flyoutButton) = 0;
	pMenuGroups-&amp;gt;Item(index, &amp;amp;pMenuGroup);
	pMenuGroups-&amp;gt;Release();
	pMenuGroup-&amp;gt;get_Toolbars(&amp;amp;pToolbars);
	pMenuGroup-&amp;gt;Release();

	CString toolbarNameTmp;
	toolbarNameTmp.Format(_T("%s Toolbar"), PLUGIN_NAME);
	BSTR toolbarName = SysAllocString(toolbarNameTmp.AllocSysString());
	
	HRESULT resultToolbar = pToolbars-&amp;gt;Add(toolbarNameTmp, &amp;amp;pToolbar);
	if (SUCCEEDED(resultToolbar))
	{
		VariantInit(&amp;amp;index);
		V_VT(&amp;amp;index) = VT_I4;
		V_I4(&amp;amp;index) = 0;

		BSTR bstrMenuItemMacro = _T("dosomething");
		BSTR bstrMenuItemName = _T("Do something");
		BSTR iconName = _T("TEST.BMP");
		pToolbar-&amp;gt;AddToolbarButton(index, bstrMenuItemName, NULL, bstrMenuItemMacro, flyoutButton, &amp;amp;pToolbarItem);
		if(pToolbarItem != NULL)
		{
			pToolbarItem-&amp;gt;SetBitmaps(iconName, iconName);
			pToolbarItem-&amp;gt;Release();
		}
		pToolbar-&amp;gt;Release();
	}
	pToolbars-&amp;gt;Release();
	SysFreeString(toolbarName);
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In the resource (.rc) I have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
"TEST"              BITMAP                  "TEST.bmp"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read in some post that the ID from the Resource should be sorrunded with " so this is one of my&amp;nbsp;attempts.&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BSTR iconName = _T("TEST"); // without the .bmp to match the resource ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And &amp;nbsp;I've confirmed that the resource is packed in the arx:&lt;BR /&gt;plugin.arx\.rsrc\1046\BITMAP\TEST.BMP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I tryied all that I found in the forums and the docs (including the VB documentation, as suggested on the posts)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 21:31:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4513713#M13207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-11T21:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4513927#M13208</link>
      <description>&lt;P&gt;I'm pretty sure that method expects a filename, not a resource name.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 03:01:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4513927#M13208</guid>
      <dc:creator>owenwengerd</dc:creator>
      <dc:date>2013-10-12T03:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4515773#M13209</link>
      <description>&lt;P&gt;Why did you comment the Resource Override out? I mean this line:&lt;/P&gt;&lt;PRE&gt;//CAcModuleResourceOverride resOverride;&lt;/PRE&gt;&lt;P&gt;It seems to me, that you are in the ACAD Resources, where your Resource is not known. You have to switch to your dll Resources (with the ResourceOverride) in order to use them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2013 09:10:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4515773#M13209</guid>
      <dc:creator>Matti72</dc:creator>
      <dc:date>2013-10-12T09:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4520097#M13210</link>
      <description>I'm passing the file name. I've tested with the resource name, wouldn't harm since it is the default while working with resources in win apis. But it's clear now the autocad expects the file name.</description>
      <pubDate>Mon, 14 Oct 2013 12:22:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4520097#M13210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-14T12:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4520261#M13211</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/70441"&gt;@Matti72&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Why did you comment the Resource Override out? I mean this line:&lt;/P&gt;&lt;PRE&gt;//CAcModuleResourceOverride resOverride;&lt;/PRE&gt;&lt;P&gt;It seems to me, that you are in the ACAD Resources, where your Resource is not known. You have to switch to your dll Resources (with the ResourceOverride) in order to use them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yep, I'm aware. I've commented just to check the impact of it. And nothing happened (with the line commented, and uncommented)...&lt;BR /&gt;So far what I learned was, the resource ID must have a name difined with quotations marks, so when the resource its packed inside the dll it will have that name, and not a constant (number defined in the resoure header).&lt;BR /&gt;Am I right? What else?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2013 12:42:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4520261#M13211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-14T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4567757#M13212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The COM API is intended for use even from external applications. As you have already found, the "SetBitmaps" method only accepts full path. This is&amp;nbsp;&lt;SPAN&gt;mentioned in the AutoCAD ActiveX API documentation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 11:46:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4567757#M13212</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-10-28T11:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4567819#M13213</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/765444"&gt;@Balaji_Ram&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The COM API is intended for use even from external applications. As you have already found, the "SetBitmaps" method only accepts full path. This is&amp;nbsp;&lt;SPAN&gt;mentioned in the AutoCAD ActiveX API documentation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So, in short, there is no way I can use the icons embeded into the dll as resources?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 12:13:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4567819#M13213</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-28T12:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Bitmap in Toolbar button</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4569861#M13214</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 11px; line-height: 14px;"&gt;Yes, t&lt;/SPAN&gt;&lt;SPAN style="font-size: 11px;"&gt;he only AutoCAD API to change the bitmap of a toolbar item is&amp;nbsp;the ActiveX method SetBitmaps and it only accepts the full file path.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2013 04:49:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/bitmap-in-toolbar-button/m-p/4569861#M13214</guid>
      <dc:creator>Balaji_Ram</dc:creator>
      <dc:date>2013-10-29T04:49:46Z</dc:date>
    </item>
  </channel>
</rss>

