<?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: Custom command in custom toolbar not working in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37824#M991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It turns out that the error I was getting in the immediate window had nothing to do with why my code wasn't working. I went through my code line by line and cleaned it out. By adding Try, Catch blocks I was able to isolate the problem. ESRI Canada tech support helped me out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ArcMap.exe Error: 0 : SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean defaultValue)
&amp;nbsp;&amp;nbsp; at XToolsNavigator.Toolbar.XToolsApplication.InitVisualApplicationSettings()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still getting these error messages in the Immediate window when running my project in Debug mode, but it doesn't seem to stop the code from working properly. I do get error messages when I exit ArcMap sometimes even when I'm not in Debug mode, so it may have something to do with my system.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 15:56:55 GMT</pubDate>
    <dc:creator>MatthewBuchanan</dc:creator>
    <dc:date>2021-12-12T15:56:55Z</dc:date>
    <item>
      <title>Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37818#M985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having trouble with creating custom toolbars with custom command buttons in Visual Studio 2005. I'm using ArcGIS 9.3.1. The button is replaced by a circle with a red line through it and the text &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;[Missing]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the projects that I try to create, even a sample toolbar from EDN doesn't work (it is an older version, but it should still work)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.0/Samples/Developer_Guide_Scenarios/ArcGIS_Desktop/Developer_Scenarios/MyToolbarVBNET/CREATEATOOLBAR.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://edndoc.esri.com/arcobjects/9.0/Samples/Developer_Guide_Scenarios/ArcGIS_Desktop/Developer_Scenarios/MyToolbarVBNET/CREATEATOOLBAR.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not sure if I should be concerned about these messages I get in the immediate window:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
ArcMap.exe Error: 0 : SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean defaultValue)
&amp;nbsp;&amp;nbsp; at XToolsNavigator.Toolbar.XToolsApplication.InitVisualApplicationSettings()
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
ArcMap.exe Error: 0 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Framework.ICommandBars.Find(Object identifier, Boolean noRecurse, Boolean noCreate)
&amp;nbsp;&amp;nbsp; at MetadataEditor.Toolbar.ArcMapUIElementsFactory.GetObjectByUID&lt;T&gt;(String uid)
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualBasic.dll&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/T&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:28:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37818#M985</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2021-12-10T21:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37819#M986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you add the license control to your form?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 11:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37819#M986</guid>
      <dc:creator>BradChappell</dc:creator>
      <dc:date>2010-08-12T11:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37820#M987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do your command classes have the proper ESRI component registration code in them?&amp;nbsp; It looks like ArcMap is not able to find your command classes, which could be a sign that they aren't registered with ArcMap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 11:16:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37820#M987</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-08-12T11:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37821#M988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil, could you please be more specific?&amp;nbsp;&amp;nbsp; How do we check the component registration?&amp;nbsp; I too hit this same problem yesterday - using 9.3 and VS 2008.&amp;nbsp; I'm building a very simple form to load the feature classes from the TOC.&amp;nbsp; My code has no errors till I compile.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 19:18:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37821#M988</guid>
      <dc:creator>NathanAmboy</dc:creator>
      <dc:date>2010-08-12T19:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37822#M989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My colleague runs the same sample code from the EDN site and does not have the same error messages that I have. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The only difference is that he is running Windows XP 32 bit and I'm running 64 bit version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are both running 9.3.1 SP2 Build 4000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll post some more code..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Aug 2010 22:30:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37822#M989</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2010-08-12T22:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37823#M990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The code of the EDN sample is downloadable from the link in my first post. This is the code for my own toolbar and command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;This is the code for my toolbar.&lt;BR /&gt;Matthew_Toolbar.vb&lt;/STRONG&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Imports ESRI.ArcGIS.ADF.CATIDs
Imports ESRI.ArcGIS.ADF.BaseClasses
Imports System.Runtime.InteropServices

&amp;lt;ComClass(Matthew_Toolbar.ClassId, Matthew_Toolbar.InterfaceId, Matthew_Toolbar.EventsId), _
 ProgId("DamMaker2_New.Matthew_Toolbar")&amp;gt; _
Public NotInheritable Class Matthew_Toolbar
&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits BaseToolbar

#Region "COM Registration Function(s)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComRegisterFunction(), ComVisibleAttribute(False)&amp;gt; _
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Sub RegisterFunction(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryRegistration(registerType)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add any COM registration code after the ArcGISCategoryRegistration() call

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComUnregisterFunction(), ComVisibleAttribute(False)&amp;gt; _
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Sub UnregisterFunction(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryUnregistration(registerType)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add any COM unregistration code after the ArcGISCategoryUnregistration() call

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

#Region "ArcGIS Component Category Registrar generated code"
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Required method for ArcGIS Component Category registration -
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Do not modify the contents of this method with the code editor.
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MxCommandBars.Register(regKey)

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Required method for ArcGIS Component Category unregistration -
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' Do not modify the contents of this method with the code editor.
&amp;nbsp;&amp;nbsp;&amp;nbsp; ''' &amp;lt;/summary&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MxCommandBars.Unregister(regKey)

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

#End Region
#End Region

#Region "COM GUIDs"
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' These&amp;nbsp; GUIDs provide the COM identity for this class 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' and its COM interfaces. If you change them, existing 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' clients will no longer be able to access the class.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const ClassId As String = "a7fdf8e2-1875-4039-bb95-4eb593320f6b"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const InterfaceId As String = "e84e68bc-5968-4285-9c2b-708a533867a0"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const EventsId As String = "a1c8d3fc-91e8-43cb-8f6f-798a6b738cfd"
#End Region

&amp;nbsp;&amp;nbsp;&amp;nbsp; ' A creatable COM class must have a Public Sub New() 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' with no parameters, otherwise, the class will not be 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' registered in the COM registry and cannot be created 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' via CreateObject.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Define your toolbar here by adding items
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem("esriArcMapUI.ZoomInFixedCommand")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem("esriArcMapUI.ZoomOutTool")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BeginGroup() 'Separator
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Today these buttons are showing up! but the command associated doesn't work properly.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem("DamMaker2_New.tool_DigitizeLine") 'try 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem("{80414059-5b90-44a6-bce9-3aeceea1f58a}") ' try 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BeginGroup() 'Separator
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem("{FBF8C3FB-0480-11D2-8D21-080009EE4E51}", 1) 'undo command
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddItem(New Guid("FBF8C3FB-0480-11D2-8D21-080009EE4E51"), 2) 'redo command
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides ReadOnly Property Caption() As String
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Replace bar caption
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "BGC DamMaker2 New"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides ReadOnly Property Name() As String
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Replace bar ID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return "Matthew_Toolbar"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Property
End Class&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;This is my command button which digitizes a line.&lt;BR /&gt;tool_DigitizeLine.vb&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Imports System.Runtime.InteropServices
Imports System.Drawing
Imports ESRI.ArcGIS.ADF.BaseClasses
Imports ESRI.ArcGIS.ADF.CATIDs
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.ArcMapUI
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Display
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Geometry
Imports System.Windows.Forms

&amp;lt;ComClass(tool_DigitizeLine.ClassId, tool_DigitizeLine.InterfaceId, tool_DigitizeLine.EventsId), _
 ProgId("DamMaker2_New.tool_DigitizeLine")&amp;gt; _
Public NotInheritable Class tool_DigitizeLine
&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits BaseTool

#Region "COM GUIDs"
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' These&amp;nbsp; GUIDs provide the COM identity for this class 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' and its COM interfaces. If you change them, existing 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' clients will no longer be able to access the class.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const ClassId As String = "80414059-5b90-44a6-bce9-3aeceea1f58a"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const InterfaceId As String = "fd639bd1-19df-4080-a2b8-a79ec0cb8071"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Const EventsId As String = "b6256c63-eecd-403a-a0a9-8695bb16021e"
#End Region

#Region "COM Registration Function(s)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComRegisterFunction(), ComVisibleAttribute(False)&amp;gt; _
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Sub RegisterFunction(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryRegistration(registerType)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add any COM registration code after the ArcGISCategoryRegistration() call

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ComUnregisterFunction(), ComVisibleAttribute(False)&amp;gt; _
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Shared Sub UnregisterFunction(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Required for ArcGIS Component Category Registrar support
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISCategoryUnregistration(registerType)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add any COM unregistration code after the ArcGISCategoryUnregistration() call

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

#Region "ArcGIS Component Category Registrar generated code"
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MxCommands.Register(regKey)

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MxCommands.Unregister(regKey)

&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

#End Region
#End Region

&amp;nbsp;&amp;nbsp;&amp;nbsp; Private m_application As IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Private m_strWorkingPath As String

&amp;nbsp;&amp;nbsp;&amp;nbsp; ' A creatable COM class must have a Public Sub New() 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' with no parameters, otherwise, the class will not be 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' registered in the COM registry and cannot be created 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' via CreateObject.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Sub New()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.New()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' TODO: Define values for the public properties
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' TODO: Define values for the public properties
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_category = "BGC DamMaker2New"&amp;nbsp; 'localizable text 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_caption = "digitize a line"&amp;nbsp;&amp;nbsp; 'localizable text 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_message = "please work!!!"&amp;nbsp;&amp;nbsp; 'localizable text 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_toolTip = "doh!" 'localizable text 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_name = "DamMaker2New_ScoobyDoo"&amp;nbsp; 'unique id, non-localizable (e.g. "MyCategory_ArcMapTool")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: change resource name if necessary
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bitmapResourceName As String = Me.GetType().Name + ".bmp"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_bitmap = New Bitmap(Me.GetType(), bitmapResourceName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_cursor = New System.Windows.Forms.Cursor(Me.GetType(), Me.GetType().Name + ".cur")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Trace.WriteLine(ex.Message, "Invalid Bitmap")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnCreate(ByVal hook As Object)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not hook Is Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_application = CType(hook, IApplication)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Disable if it is not ArcMap
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If TypeOf hook Is IMxApplication Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_enabled = True
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase.m_enabled = False
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' TODO:&amp;nbsp; Add other initialization code
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnClick()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Add tool_DigitizeLine.OnClick implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox("Please digitize a dam centre line now." &amp;amp; vbCrLf &amp;amp; "Make sure it doesn't go beyond the edges of your DEM." &amp;amp; _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbCrLf &amp;amp; "Start line from the left bank (facing downstream)" &amp;amp; vbCrLf &amp;amp; "(left side of line is downstream)" &amp;amp; _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbCrLf &amp;amp; "If the selected shapefile exists, it will be deleted", , "BGC DamMaker2")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnMouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Integer, ByVal Y As Integer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Add tool_DigitizeLine.OnMouseDown implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'MsgBox("now you can digitize")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mxdocument As IMxDocument = m_application.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get mxDocument from modTools function GetMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Dim mxDocument As IMxDocument = GetMxDocument(m_application)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DigitizeLine(MxDocument)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnMouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Integer, ByVal Y As Integer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Add tool_DigitizeLine.OnMouseMove implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub

&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub OnMouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Integer, ByVal Y As Integer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'TODO: Add tool_DigitizeLine.OnMouseUp implementation
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
End Class
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't attach the whole code because the editor complained that it was too long.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is another Sub in the tool_DigitizeLine.vb module that does the actual work, and it calls some functions in a modTools.vb code module. They are attached in a zip file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37823#M990</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2021-12-12T15:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37824#M991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It turns out that the error I was getting in the immediate window had nothing to do with why my code wasn't working. I went through my code line by line and cleaned it out. By adding Try, Catch blocks I was able to isolate the problem. ESRI Canada tech support helped me out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ArcMap.exe Error: 0 : SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.
&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(Boolean defaultValue)
&amp;nbsp;&amp;nbsp; at XToolsNavigator.Toolbar.XToolsApplication.InitVisualApplicationSettings()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am still getting these error messages in the Immediate window when running my project in Debug mode, but it doesn't seem to stop the code from working properly. I do get error messages when I exit ArcMap sometimes even when I'm not in Debug mode, so it may have something to do with my system.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37824#M991</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2021-12-12T15:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37825#M992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;be sure you compile your code with x86 propertie and not Any CPU propertie.&amp;nbsp; You need this to run your application on a 64 bit machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Vincent&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 19:12:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37825#M992</guid>
      <dc:creator>vincentLahaye</dc:creator>
      <dc:date>2010-08-20T19:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Custom command in custom toolbar not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37826#M993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Under Project Properties, Compile, Advanced Compile Options&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Target CPU:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x86&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- I still get the same Immediate window messages on my x64 machine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I change to &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Target CPU:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;x64&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get these errors and warnings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error 1 File "C:\TOOLS\Visual Studio 2005\Projects\DamMaker2_New\bin\Release\DamMaker2_New.dll" is not a valid assembly. DamMaker2_New&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Warning 2 Possible problem detected while building assembly 'DamMaker2_New': Referenced assembly 'mscorlib.dll' targets a different processor &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Warning 3 Possible problem detected while building assembly 'DamMaker2_New': Referenced assembly 'System.Data.dll' targets a different processor &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since ArcMap is a 32 bit program, do I need to use a 32 bit OS to compile Visual Studio projects for ArcMap?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Aug 2010 19:45:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/custom-command-in-custom-toolbar-not-working/m-p/37826#M993</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2010-08-20T19:45:09Z</dc:date>
    </item>
  </channel>
</rss>

