<?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: one dll for more version in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284466#M12438</link>
    <description>&lt;P&gt;Have you tried to manually load your DLL with "NETLOAD" command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to have your DLL implement IExtensionApplication interface, and add simple code (such as editor.WriteMessage("\nHello World!");) so that you can see if the dll is loaded correctly or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 01:14:20 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2022-07-08T01:14:20Z</dc:date>
    <item>
      <title>one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11282657#M12435</link>
      <description>&lt;P&gt;Hi guys!&lt;/P&gt;&lt;P&gt;My plugin is almost finished, but it can only be used for cad 2019 and 2020 versions.I used .net 4.7 and Autocad2020.&lt;/P&gt;&lt;P&gt;I hope it can be used for 2018-2022 versions..&lt;/P&gt;&lt;P&gt;I searched a lot of posts, but most of them needed to be changed when I first created the project, but my project is almost complete....&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 10:00:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11282657#M12435</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-07T10:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11283107#M12436</link>
      <description>&lt;P&gt;What is the reason that you say "... it can only be used for 2019 and 2020..."? It should work with all later versions of AutoCAD, or even 2018.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:18:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11283107#M12436</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-07-07T13:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284458#M12437</link>
      <description>&lt;P&gt;I have tested with 2018 and 2022.... But my plugin doesn't show anything.&lt;BR /&gt;My custom menu, I used Cuiload alone to load, but the buttons can not be used, showing "unknown command"....&lt;span class="lia-unicode-emoji" title=":loudly_crying_face:"&gt;😭&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":loudly_crying_face:"&gt;😭&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 01:03:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284458#M12437</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-08T01:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284466#M12438</link>
      <description>&lt;P&gt;Have you tried to manually load your DLL with "NETLOAD" command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to have your DLL implement IExtensionApplication interface, and add simple code (such as editor.WriteMessage("\nHello World!");) so that you can see if the dll is loaded correctly or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 01:14:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284466#M12438</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-07-08T01:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284483#M12439</link>
      <description>&lt;P&gt;I also tried manually loading my DLL using "NETLOAD".&lt;/P&gt;&lt;P&gt;But none of my custom commands are loaded,including my custom ribbon...&lt;span class="lia-unicode-emoji" title=":crying_face:"&gt;😢&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 01:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284483#M12439</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-08T01:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284500#M12440</link>
      <description>&lt;P&gt;I tried adding this simple code(&lt;SPAN&gt;editor.WriteMessage("\nHello World!");&lt;/SPAN&gt;), but 2022 doesn't seem to be loading my plug-in.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hoohoo_0-1657244678999.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1089255iF1A867841619127E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hoohoo_0-1657244678999.png" alt="hoohoo_0-1657244678999.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 01:44:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11284500#M12440</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-08T01:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11285349#M12441</link>
      <description>&lt;P&gt;I do not know what your DLL does, but if it works with Acad2020, there would be very few reasons it would not work in Acad2022.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have extra code other than "Hello World" in IExtensionApplication.Initialize()? If you do, what the code does? Do you have try...catch... surrounding all the code in the Initialize()?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The picture you showed seems indicating you have something in the Initialize() and you added the "Hello World" at the end. Because the code fails before "Hello world", so, you cannot see it. I am also guessing your code (according the picture) is to load your dynamic ribbon menu in the Initialize(), where you try to add your own ribbon items (tab/panel...) while AutoCAD's ribbon control has not been created, which would fail the Initialize() execution. If you stop loading your DLL on AutoCAD startup and try load it manually with "NETLOAD", I bet it would work, which would prove my guess is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 12:34:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11285349#M12441</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2022-07-08T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11288860#M12442</link>
      <description>&lt;P&gt;Thank you very much for the suggestion!!!!!&lt;/P&gt;&lt;P&gt;Now my plugin is indeed loaded, but a little problem is that my menu and toolbar are not displayed...&lt;span class="lia-unicode-emoji" title=":loudly_crying_face:"&gt;😭&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The following code is &amp;nbsp;what I initialized...&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.Windows


''' &amp;lt;summary&amp;gt;
''' 加载插件自动加载Ribbon
''' &amp;lt;/summary&amp;gt;
Public Class ACadPlugin
    Implements IExtensionApplication

    Public Sub Initialize() Implements IExtensionApplication.Initialize
        AddHandler ComponentManager.ItemInitialized, AddressOf CompentManager_ItemInitialized

        If ComponentManager.Ribbon IsNot Nothing And CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            Cui.addMenu()
            CreateRibbon.CreateRibbon()
            Registration.LoginWindow.Instance.Show(True)
        End If
    End Sub

    Private Sub CompentManager_ItemInitialized(sender As Object, e As RibbonItemEventArgs)
        If CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            Cui.addMenu()
            CreateRibbon.CreateRibbon()
			Registration.LoginWindow.Instance.Show(True)
		End If
    End Sub

    Public Sub Terminate() Implements IExtensionApplication.Terminate
    End Sub
End Class&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 03:58:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11288860#M12442</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-11T03:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11288953#M12443</link>
      <description>&lt;P&gt;When I commented this code（"&amp;nbsp;Cui.addMenu()"） netload to load my plugin correctly.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.Windows


''' &amp;lt;summary&amp;gt;
''' 加载插件自动加载Ribbon
''' &amp;lt;/summary&amp;gt;
Public Class ACadPlugin
    Implements IExtensionApplication

    Public Sub Initialize() Implements IExtensionApplication.Initialize
        AddHandler ComponentManager.ItemInitialized, AddressOf CompentManager_ItemInitialized

        If ComponentManager.Ribbon IsNot Nothing And CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            'Cui.addMenu()
            CreateRibbon.CreateRibbon()
            Registration.LoginWindow.Instance.Show(True)
        End If
    End Sub

    Private Sub CompentManager_ItemInitialized(sender As Object, e As RibbonItemEventArgs)
        If CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            'Cui.addMenu()
            CreateRibbon.CreateRibbon()
			Registration.LoginWindow.Instance.Show(True)
		End If
    End Sub

    Public Sub Terminate() Implements IExtensionApplication.Terminate
    End Sub
End Class&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 05:42:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11288953#M12443</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-11T05:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: one dll for more version</title>
      <link>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11289308#M12444</link>
      <description>&lt;P&gt;I've realized where my problem is and solved it! Thank you very much for your help!!!&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Customization
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.Windows
Imports DotNetARX

''' &amp;lt;summary&amp;gt;
''' 加载插件自动加载Ribbon
''' &amp;lt;/summary&amp;gt;
Public Class ACadPlugin
    Implements IExtensionApplication
    Public Shared cuiFile As String = Tools.GetCurrentPath() &amp;amp; "\XHCFTool.cuix"

    Public Sub Initialize() Implements IExtensionApplication.Initialize
        AddHandler ComponentManager.ItemInitialized, AddressOf CompentManager_ItemInitialized
        If ComponentManager.Ribbon IsNot Nothing And CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            Application.LoadPartialMenu(cuiFile)
            CreateRibbon.CreateRibbon()
            Registration.LoginWindow.Instance.Show(True)
        End If
    End Sub

    Private Sub CompentManager_ItemInitialized(sender As Object, e As RibbonItemEventArgs)
        If CreateRibbon.SPVDtab Is Nothing Then
            BlockDoubleClick.modifyMacroCUI()
            Application.LoadPartialMenu(cuiFile)
            CreateRibbon.CreateRibbon()
            Registration.LoginWindow.Instance.Show(True)
        End If
    End Sub

    Public Sub Terminate() Implements IExtensionApplication.Terminate
        Application.UnloadPartialMenu(cuiFile)
    End Sub
End Class&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 10:08:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/one-dll-for-more-version/m-p/11289308#M12444</guid>
      <dc:creator>安娜hoohoo</dc:creator>
      <dc:date>2022-07-11T10:08:25Z</dc:date>
    </item>
  </channel>
</rss>

