<?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: Install toolbar CUI.NET API in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748179#M80593</link>
    <description>Hi, Tony Tanzillo!&lt;BR /&gt;
Many thanks for explanation!&lt;BR /&gt;
&lt;BR /&gt;
I have a little question. Is it possible to load (LoadLibrary or any other way) all needed&lt;BR /&gt;
dll-files in order to not copy its in directory of application?&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.</description>
    <pubDate>Tue, 29 Aug 2006 08:54:30 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-08-29T08:54:30Z</dc:date>
    <item>
      <title>Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748176#M80590</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I am trying to add a new toolbar to Acad 2007 from a windows installation &lt;BR /&gt;
package using the CUI .NET API. The idea is to execute it from a custom action.&lt;BR /&gt;
&lt;BR /&gt;
By modifying the C# code in the documentation I have the following code,&lt;BR /&gt;
&lt;BR /&gt;
    Sub Main()&lt;BR /&gt;
&lt;BR /&gt;
        Dim csstring As String = "C:\Documents and Settings\UserX\Application Data\Autodesk\AutoCAD 2007\R17.0\enu\Support\acad.cui"&lt;BR /&gt;
       &lt;BR /&gt;
        Dim cs As CustomizationSection&lt;BR /&gt;
        cs = New CustomizationSection(csstring)&lt;BR /&gt;
&lt;BR /&gt;
        Dim newTB As Toolbar = New Toolbar("MyToolbar", cs.MenuGroup)&lt;BR /&gt;
        newTB.ToolbarOrient = ToolbarOrient.floating&lt;BR /&gt;
        newTB.ToolbarVisible = ToolbarVisible.show&lt;BR /&gt;
&lt;BR /&gt;
	 &lt;BR /&gt;
        Dim tbBtn As ToolbarButton = New ToolbarButton(newTB, -1)&lt;BR /&gt;
        tbBtn.Name = "Pline"&lt;BR /&gt;
        tbBtn.MacroID = "ID_Pline"&lt;BR /&gt;
&lt;BR /&gt;
        For Each wk As Workspace In cs.Workspaces&lt;BR /&gt;
            Dim wkTb As WorkspaceToolbar = New WorkspaceToolbar(wk, newTB)&lt;BR /&gt;
            wk.WorkspaceToolbars.Add(wkTb)&lt;BR /&gt;
            wkTb.Display = 1&lt;BR /&gt;
        Next&lt;BR /&gt;
&lt;BR /&gt;
        cs.Save()&lt;BR /&gt;
&lt;BR /&gt;
    End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
But I get the following error on the cs = New CustomizationSection(csstring) line.&lt;BR /&gt;
&lt;BR /&gt;
System.IO.FileNotFoundException was unhandled&lt;BR /&gt;
  Message="The specified module could not be found. (Exception from HRESULT: 0x8007007E)"&lt;BR /&gt;
  Source="AcCustomize"&lt;BR /&gt;
  &lt;BR /&gt;
If I put the code into a command, NETLOAD the dll, and instead of&lt;BR /&gt;
hardcoding the location of the acad.cui file I obtain it with the&lt;BR /&gt;
application variable  Application.GetSystemVariable("MENUNAME"),&lt;BR /&gt;
the code works fine.  But as the documentation says, the application &lt;BR /&gt;
variable is not available to Stand-alone Applications, so I need to&lt;BR /&gt;
get it to work with a hardcoded string. &lt;BR /&gt;
&lt;BR /&gt;
The application MENUNAME variable returns EXACTLY the same value that I provide&lt;BR /&gt;
in the hardcoded path (minus .cui), and I have also tried to use double &lt;BR /&gt;
backslash in the path or move the file to c:\acad.cui but I still &lt;BR /&gt;
get the same error. &lt;BR /&gt;
&lt;BR /&gt;
Has anyone had the same problem or have any ideas on how to solve it ?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
&lt;BR /&gt;
Julian</description>
      <pubDate>Mon, 28 Aug 2006 14:35:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748176#M80590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-28T14:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748177#M80591</link>
      <description>Are you sure that it is allowed to call AutoCAD .NET assembly from standalong application? IMHO it is impossible. Exception  not pointed to path (string csstring) but to AcCustomize.dll which is not found. It is needed for CustomizationSection class. Message="The specified module could not be found" - describe this situation.&lt;BR /&gt;
&lt;BR /&gt;
Oops! Sorry! I was wrong! It is possible! Copy your's application in AutoCAD directory and start it. I think problem that your's application can not found some of assembly/module those are in AutoCAD directory.&lt;BR /&gt;
&lt;BR /&gt;
Another way is coping next files from AutoCAD directory to application directory:&lt;BR /&gt;
[code]&lt;BR /&gt;
ac1st17.dll&lt;BR /&gt;
AcCui.dll&lt;BR /&gt;
AcCustomize.dll&lt;BR /&gt;
acdb17.dll&lt;BR /&gt;
acdb17enures.dll&lt;BR /&gt;
acdbmgd.dll&lt;BR /&gt;
acge17.dll&lt;BR /&gt;
acmgd.dll&lt;BR /&gt;
AcMNUParser.dll&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.</description>
      <pubDate>Mon, 28 Aug 2006 22:54:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748177#M80591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-28T22:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748178#M80592</link>
      <description>Alex - The CUI interface is an exception.&lt;BR /&gt;
&lt;BR /&gt;
It has no dependence on AutoCAD and was designed&lt;BR /&gt;
that way so that it could be use for installation.&lt;BR /&gt;
&lt;BR /&gt;
Unfortunately they left out a few key pieces, related&lt;BR /&gt;
more to general information, such as what CUI files&lt;BR /&gt;
are loaded into a given installation.&lt;BR /&gt;
&lt;BR /&gt;
So, it must be done manually (look in registry for the&lt;BR /&gt;
name of the main and enterprise menus, and then&lt;BR /&gt;
use the AutoCAD library search path to find them).&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;ALEXANDER rivilis=""&gt; wrote in message news:5310255@discussion.autodesk.com...&lt;BR /&gt;
Are you sure that it is allowed to call AutoCAD .NET assembly from standalong application? IMHO it is impossible. Exception  not pointed to path (string csstring) but to AcCustomize.dll which is not found. It is needed for CustomizationSection class. Message="The specified module could not be found" - describe this situation.&lt;/ALEXANDER&gt;</description>
      <pubDate>Tue, 29 Aug 2006 06:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748178#M80592</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T06:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748179#M80593</link>
      <description>Hi, Tony Tanzillo!&lt;BR /&gt;
Many thanks for explanation!&lt;BR /&gt;
&lt;BR /&gt;
I have a little question. Is it possible to load (LoadLibrary or any other way) all needed&lt;BR /&gt;
dll-files in order to not copy its in directory of application?&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.</description>
      <pubDate>Tue, 29 Aug 2006 08:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748179#M80593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T08:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748180#M80594</link>
      <description>Hi Alex.&lt;BR /&gt;
&lt;BR /&gt;
Sorry, I'm not sure I understand the question.&lt;BR /&gt;
&lt;BR /&gt;
(You can use Assembly.Load() to load a managed assembly)&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Alexander Rivilis" &lt;RIVILIS&gt; wrote in message news:5310540@discussion.autodesk.com...&lt;BR /&gt;
Hi, Tony Tanzillo!&lt;BR /&gt;
Many thanks for explanation!&lt;BR /&gt;
&lt;BR /&gt;
I have a little question. Is it possible to load (LoadLibrary or any other way) all needed&lt;BR /&gt;
dll-files in order to not copy its in directory of application?&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.&lt;/RIVILIS&gt;</description>
      <pubDate>Tue, 29 Aug 2006 16:30:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748180#M80594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T16:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748181#M80595</link>
      <description>Hi Tony!&lt;BR /&gt;
Yes! You undestand me! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; For Assembly I can Assembly.Load() but ac1st17.dll acdb17.dll acdb17enures.dll acge17.dll  not Assembly. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Is it possible to load ordinary dll-file? With P/Invoke LoadLibrary? Is it enough in order to application look for those dll-files in current directory?&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Alexander Rivilis</description>
      <pubDate>Tue, 29 Aug 2006 17:08:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748181#M80595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T17:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748182#M80596</link>
      <description>Ok! I've found solution:&lt;BR /&gt;
[code]&lt;BR /&gt;
'Declaration:&lt;BR /&gt;
  &lt;DLLIMPORT&gt; _&lt;BR /&gt;
  Private Shared Function SetDllDirectoryA(ByVal path As String) As Integer&lt;BR /&gt;
  End Function&lt;BR /&gt;
'Using sample:&lt;BR /&gt;
 SetDllDirectoryA("C:\Program Files\AutoCAD 2007") ' Now Application looking for ordinary dll-files in AutoCAD directory.&lt;BR /&gt;
[/code]&lt;BR /&gt;
AcCui.dll, AcCustomize.dl,l acdbmgd.dll, acmgd.dll, AcMNUParser.dll have to be in&lt;BR /&gt;
directory of application or loaded manually before using.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.&lt;/DLLIMPORT&gt;</description>
      <pubDate>Tue, 29 Aug 2006 19:08:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748182#M80596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T19:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748183#M80597</link>
      <description>The system searches the directories on the PATH &lt;BR /&gt;
environment variable; the current directory; and&lt;BR /&gt;
the directory of the calling process, for DLLs loaded &lt;BR /&gt;
via loadlibrary (without a path specified).&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Alexander Rivilis" &lt;RIVILIS&gt; wrote in message news:5311336@discussion.autodesk.com...&lt;BR /&gt;
Ok! I've found solution:&lt;BR /&gt;
[code]&lt;BR /&gt;
'Declaration:&lt;BR /&gt;
  &lt;DLLIMPORT&gt; _&lt;BR /&gt;
  Private Shared Function SetDllDirectoryA(ByVal path As String) As Integer&lt;BR /&gt;
  End Function&lt;BR /&gt;
'Using sample:&lt;BR /&gt;
 SetDllDirectoryA("C:\Program Files\AutoCAD 2007") ' Now Application looking for ordinary dll-files in AutoCAD directory.&lt;BR /&gt;
[/code]&lt;BR /&gt;
AcCui.dll, AcCustomize.dl,l acdbmgd.dll, acmgd.dll, AcMNUParser.dll have to be in&lt;BR /&gt;
directory of application or loaded manually before using.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.&lt;/DLLIMPORT&gt;&lt;/RIVILIS&gt;</description>
      <pubDate>Tue, 29 Aug 2006 21:46:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748183#M80597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-29T21:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748184#M80598</link>
      <description>Note that if you're doing a non-trivial amount of P/Invoke-ing, you might &lt;BR /&gt;
want to consider using C++/CLI instead.  This will let you access native &lt;BR /&gt;
ObjectARX functionality directly and expose your own .NET interface.&lt;BR /&gt;
&lt;BR /&gt;
   Dan&lt;BR /&gt;
&lt;BR /&gt;
"Alexander Rivilis" &lt;RIVILIS&gt; wrote in message &lt;BR /&gt;
news:5311336@discussion.autodesk.com...&lt;BR /&gt;
Ok! I've found solution:&lt;BR /&gt;
[code]&lt;BR /&gt;
'Declaration:&lt;BR /&gt;
  &lt;DLLIMPORT&gt; _&lt;BR /&gt;
  Private Shared Function SetDllDirectoryA(ByVal path As String) As Integer&lt;BR /&gt;
  End Function&lt;BR /&gt;
'Using sample:&lt;BR /&gt;
 SetDllDirectoryA("C:\Program Files\AutoCAD 2007") ' Now Application looking &lt;BR /&gt;
for ordinary dll-files in AutoCAD directory.&lt;BR /&gt;
[/code]&lt;BR /&gt;
AcCui.dll, AcCustomize.dl,l acdbmgd.dll, acmgd.dll, AcMNUParser.dll have to &lt;BR /&gt;
be in&lt;BR /&gt;
directory of application or loaded manually before using.&lt;BR /&gt;
&lt;BR /&gt;
Best Regards,&lt;BR /&gt;
Alexander Rivilis.&lt;/DLLIMPORT&gt;&lt;/RIVILIS&gt;</description>
      <pubDate>Wed, 30 Aug 2006 13:22:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748184#M80598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-30T13:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748185#M80599</link>
      <description>ObjectARX functionality is not allowed in standalone application (IMHO)! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 30 Aug 2006 13:26:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748185#M80599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-30T13:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748186#M80600</link>
      <description>Can someone elaborate on this?  I'm doing a similar thing (create an installation setup).&lt;BR /&gt;
&lt;BR /&gt;
I've got all the information I need from the registry (cui location, program install path location), but I don't know how point my solution to allow looking in the local AutoCAD install folder for the AcCui.dll (and the others).&lt;BR /&gt;
&lt;BR /&gt;
I'm using C# and I am not sure how to implement the SetDllDirectoryA function from VB.&lt;BR /&gt;
&lt;BR /&gt;
Any clues?</description>
      <pubDate>Wed, 08 Apr 2009 18:24:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748186#M80600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-08T18:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748187#M80601</link>
      <description>There was a free 2010 CUIX API webcast course recently. It has not yet been posted for download but there are others available. Here is the link.&lt;BR /&gt;
&lt;BR /&gt;
http://www.adskconsulting.com/adn/cs/api_course_sched.php</description>
      <pubDate>Wed, 08 Apr 2009 18:47:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748187#M80601</guid>
      <dc:creator>GTVic</dc:creator>
      <dc:date>2009-04-08T18:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Install toolbar CUI.NET API</title>
      <link>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748188#M80602</link>
      <description>I emailed Wayne Brill about this since it (modifying a cui outside of AutoCAD) wasn't covered in the presentation.  Here's the response (an excerpt from a previous case).&lt;BR /&gt;
It is not legal to ship the AutoCAD specific DLL’s with your application. But you may copy the already installed CUI DLL’s on a machine into your applications installation directory during the installation process. That is the machine must have AutoCAD installed on it. &lt;BR /&gt;
&lt;BR /&gt;
I am not sure if it is compulsory for you to go with the standalone approach but I would like to put forth some of the comments that came up during the discussion with my colleagues regarding this case. Although, it is mentioned that you can build standalone applications looks like it is not a good idea and the reasons being: &lt;BR /&gt;
&lt;BR /&gt;
1. As I mentioned above, developers aren’t permitted to ship the CUI DLL’s with their applications, so that rules out installing CUI DLL’s with your application. &lt;BR /&gt;
(Maybe a workaround to this would be for the installer to copy the already installed CUI DLL on a machine into its install directory, but that's messy)&lt;BR /&gt;
&lt;BR /&gt;
2. The CUI DLL resides in the AutoCAD install directory, but is not a strong named assembly, so has no entry in the GAC. Therefore, to use it the developer must either &lt;BR /&gt;
a. Run his executable from the AutoCAD install directory. &lt;BR /&gt;
&lt;BR /&gt;
b. Dynamically find and load the CUI DLL at runtime &lt;BR /&gt;
You may want to take a look at the following solution in MSDN:&lt;BR /&gt;
How to load an assembly at runtime that is located in a folder that is not the bin folder of the application&lt;BR /&gt;
http://support.microsoft.com/kb/837908&lt;BR /&gt;
&lt;BR /&gt;
c. Have a hard coded dependency on a specific location for the CUI DLL. This then assumes AutoCAD is installed in the default directory. &lt;BR /&gt;
System.IO.Directory.SetCurrentDirectory();&lt;BR /&gt;
&lt;BR /&gt;
Of the above installing in the AutoCAD directory is probably the best.&lt;BR /&gt;
&lt;BR /&gt;
Dynamically find and load the CUI DLL at runtime [would be] the best option if it worked. Unfortunately, it seems that .exe directory is hard-coded when AcCustomize.dll is loaded from AcCUI.dll. Even if AcCustomize.dll is already loaded, the FileNotFoundException is thrown if exe_dir\AcCustomize.dll is not found. &lt;BR /&gt;
Please record this issue as a Change Request.</description>
      <pubDate>Thu, 09 Apr 2009 19:30:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/install-toolbar-cui-net-api/m-p/1748188#M80602</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-04-09T19:30:14Z</dc:date>
    </item>
  </channel>
</rss>

