.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with AcRibbon.dll

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
1740 Views, 3 Replies

Problems with AcRibbon.dll

In my Managed C++ project, I added a reference to AcRibbon.dll. After
having done that, in VS2005, the build is not successful; below are few
lines from the build Output. The build process seemingly goes on and on.
Any idea what is going on here? Thanks!

Gagan
-------------------------

1>------ Build started: Project: AppCore, Configuration: Debug Any CPU
------
1>AppCore -> C:\App\Starmaker\Output\Bin\debug\core\AppCore.dll
2>------ Build started: Project: ARXRunTime, Configuration: Debug Win32
------
2>Copying 'c:\Program Files\AutoCAD 2009\acdbmgd.dll' to target directory...
2>Copying 'c:\Program Files\AutoCAD 2009\acmgd.dll' to target directory...
2>Copying 'c:\Program Files\AutoCAD 2009\acmgdinternal.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\AcWindows.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\AcRibbon.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\en-US\AcRibbon.resources.dll'
to target directory...
2>Compiling...
2>StdAfx.cpp
2>c:\program files\autocad 2009\acwindows.dll : error C2220: warning
treated as error - no 'object' file generated
2>c:\program files\autocad 2009\acwindows.dll : warning C4945:
'GeneratedInternalTypeHelper' : cannot import symbol from 'c:\program
files\autocad 2009\acwindows.dll': as
'XamlGeneratedNamespace::GeneratedInternalTypeHelper' has already been
imported from another assembly 'AdWindows'
2> c:\program files\autocad 2009\adwindows.dll : see declaration
of 'XamlGeneratedNamespace::GeneratedInternalTypeHelper'
2> first seen type is used; re-order imported assemblies to use
the current type
2> This diagnostic occurred while importing type
'XamlGeneratedNamespace.GeneratedInternalTypeHelper' from assembly
'AcWindows, Version=17.2.0.0, Culture=neutral, PublicKeyToken=null'.
2>c:\program files\autocad 2009\acribbon.dll : warning C4945:
'GeneratedInternalTypeHelper' : cannot import symbol from 'c:\program
files\autocad 2009\acribbon.dll': as
'XamlGeneratedNamespace::GeneratedInternalTypeHelper' has already been
imported from another assembly 'AdWindows'
2> c:\program files\autocad 2009\adwindows.dll : see declaration
of 'XamlGeneratedNamespace::GeneratedInternalTypeHelper'
2> first seen type is used; re-order imported assemblies to use
the current type
2> This diagnostic occurred while importing type
'XamlGeneratedNamespace.GeneratedInternalTypeHelper' from assembly
'AcRibbon, Version=17.2.0.0, Culture=neutral, PublicKeyToken=null'.
2>x:\output\bin\debug\core\acdbmgd.dll : warning C4945:
'LineWeightConverter' : cannot import symbol from
'x:\output\bin\debug\core\acdbmgd.dll': as
'Autodesk::AutoCAD::DatabaseServices::LineWeightConverter' has already
been imported from another assembly 'acdbmgd'
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

Seems accui.dll is the file you should be using which uses acribbon.dll for services.
Just a quick look as I haven't used it.

"Gagan Gajabaharia" wrote in message news:6109168@discussion.autodesk.com...
In my Managed C++ project, I added a reference to AcRibbon.dll. After
having done that, in VS2005, the build is not successful; below are few
lines from the build Output. The build process seemingly goes on and on.
Any idea what is going on here? Thanks!

Gagan
-------------------------

1>------ Build started: Project: AppCore, Configuration: Debug Any CPU
------
1>AppCore -> C:\App\Starmaker\Output\Bin\debug\core\AppCore.dll
2>------ Build started: Project: ARXRunTime, Configuration: Debug Win32
------
2>Copying 'c:\Program Files\AutoCAD 2009\acdbmgd.dll' to target directory...
2>Copying 'c:\Program Files\AutoCAD 2009\acmgd.dll' to target directory...
2>Copying 'c:\Program Files\AutoCAD 2009\acmgdinternal.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\AcWindows.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\AcRibbon.dll' to target
directory...
2>Copying 'c:\Program Files\AutoCAD 2009\en-US\AcRibbon.resources.dll'
to target directory...
2>Compiling...
2>StdAfx.cpp
2>c:\program files\autocad 2009\acwindows.dll : error C2220: warning
treated as error - no 'object' file generated
2>c:\program files\autocad 2009\acwindows.dll : warning C4945:
'GeneratedInternalTypeHelper' : cannot import symbol from 'c:\program
files\autocad 2009\acwindows.dll': as
'XamlGeneratedNamespace::GeneratedInternalTypeHelper' has already been
imported from another assembly 'AdWindows'
2> c:\program files\autocad 2009\adwindows.dll : see declaration
of 'XamlGeneratedNamespace::GeneratedInternalTypeHelper'
2> first seen type is used; re-order imported assemblies to use
the current type
2> This diagnostic occurred while importing type
'XamlGeneratedNamespace.GeneratedInternalTypeHelper' from assembly
'AcWindows, Version=17.2.0.0, Culture=neutral, PublicKeyToken=null'.
2>c:\program files\autocad 2009\acribbon.dll : warning C4945:
'GeneratedInternalTypeHelper' : cannot import symbol from 'c:\program
files\autocad 2009\acribbon.dll': as
'XamlGeneratedNamespace::GeneratedInternalTypeHelper' has already been
imported from another assembly 'AdWindows'
2> c:\program files\autocad 2009\adwindows.dll : see declaration
of 'XamlGeneratedNamespace::GeneratedInternalTypeHelper'
2> first seen type is used; re-order imported assemblies to use
the current type
2> This diagnostic occurred while importing type
'XamlGeneratedNamespace.GeneratedInternalTypeHelper' from assembly
'AcRibbon, Version=17.2.0.0, Culture=neutral, PublicKeyToken=null'.
2>x:\output\bin\debug\core\acdbmgd.dll : warning C4945:
'LineWeightConverter' : cannot import symbol from
'x:\output\bin\debug\core\acdbmgd.dll': as
'Autodesk::AutoCAD::DatabaseServices::LineWeightConverter' has already
been imported from another assembly 'acdbmgd'
Message 3 of 4
Anonymous
in reply to: Anonymous

Paul Richardson
> Seems accui.dll is the file you should be using which uses acribbon.dll for services.
> Just a quick look as I haven't used it.
>

Thanks, Paul.

I referenced Accui.dll, and it also results in the same errors as before.

Funnily, if I reference AcRibbon.dll in a VB.NET or C# project, the
VS2005 has no problems at all.

Are there any sample code for Ribbon API consumption from a managed C++?

Gagan
Message 4 of 4
Anonymous
in reply to: Anonymous

Hi, two years later,
I was looking for differences in the implementation of Ribbon from the 2009 and 2010 and I saw this message.

I have found that many classes have moved Autodesk.AutoCAD.Ribbon namespace (AcRibbon.dll in 2009) to the namespace Autodesk.AutoCAD.Customization (AcCui.dll in 2010).
I do not know if this is a simple reorganization of classes or a deeper refactoring.
What I can tell you is how to implement Ribbon in C++, compiled with option /clr: oldsyntax  (this notation is obsolete but i like it more.)
 

1- Using VS2005 for AutoCAD 2009:

 

-- In stdafx.h add this lines:

#using <mscorlib.dll>
#using <System.dll>

#using <acdbmgd.dll>
#using <acmgd.dll>
#using <AcRibbon.dll>
#using <AdWindows.dll>
#using <PresentationCore.dll>
#using <PresentationFramework.dll>
#using <WindowsBase.dll>

 

--- MyRibbonTabProxy.h

#pragma once

#include "StdAfx.h"

using namespace System;
using namespace Autodesk::Windows;
using namespace Autodesk::AutoCAD::Ribbon;

void MakeIt(void);

public __gc class MyRibbonTabProxy
{
 private:
  RibbonTab*  m_RibTab;
 public:
  MyRibbonTabProxy(String* title, String* id );
 protected:
  void OnButtonClick(Object* sender, Windows::RoutedEventArgs * ea);

};

 

--- MyRibbonTabProxy.cpp

#include "StdAfx.h"
#include "MyRibbonTabProxy.h"

 


void MakeIt()
{
 MyRibbonTabProxy* rb = new MyRibbonTabProxy( S"CadOfiTec", S"CadOfiTecTab" );
}


MyRibbonTabProxy::MyRibbonTabProxy(String* title, String* id )
{
 RibbonControl* ribCtrl = Autodesk::AutoCAD::Ribbon::RibbonServices::RibbonPaletteSet->RibbonControl;
 if( ribCtrl == NULL )
  return;
 
 m_RibTab =  ribCtrl->FindTab( id );
 if( m_RibTab != NULL )
  return;

 m_RibTab = new RibbonTab();
 m_RibTab->Title = title;
 m_RibTab->Id = id;
 ribCtrl->Tabs->Add( m_RibTab );
 m_RibTab->IsActive = true;

 // Create the panel source
 RibbonPanelSource* ribSourcePanel = new RibbonPanelSource();
 ribSourcePanel->Title = "Bloques";
 
 RibbonPanel* ribPanel = new RibbonPanel;
 ribPanel->Source = ribSourcePanel;
 m_RibTab->Panels->Add( ribPanel );
 
 // Create a button
 RibbonButton* ribButton1 = new RibbonButton();
 ribButton1->Text = S"AddTE";
 ribButton1->Click += new Windows::RoutedEventHandler(this, &MyRibbonTabProxy:: OnAddTEClick);
 ribButton1->ShowText = true;

 RibbonRow* row = new RibbonRow();
 row->Items->Add(ribButton1);
 ribSourcePanel->Rows->Add( row );

}

void MyRibbonTabProxy:: OnAddTEClick(Object* sender, Windows::RoutedEventArgs *ea)
{
 Autodesk::AutoCAD::ApplicationServices::Application:: DocumentManager
  ->MdiActiveDocument->SendStringToExecute(S"_AddTE ",false, false, false );
}

 



2 - Using VS2008 for AutoCAD 2011:

 

-- In stdafx.h add this lines:

#using <mscorlib.dll>
#using <System.dll>

#using <acdbmgd.dll>
#using <acmgd.dll>
#using <AcCui.dll>
#using <AdWindows.dll>
#using <PresentationCore.dll>
#using <PresentationFramework.dll>
#using <WindowsBase.dll>

 

#pragma once

#include "StdAfx.h"

using namespace System;
using namespace Autodesk::Windows;

void MakeIt(void);

 

// The new implementation uses ICommand instead RoutedEventHandler

 

public __gc class AutoCADCommandHandler: public ICommand
{
public:
 void remove_CanExecuteChanged(System::EventHandler* eh){};
 void add_CanExecuteChanged(System::EventHandler* eh){};

 AutoCADCommandHandler(){};
 bool CanExecute(Object* parameter);
 void Execute(Object* parameter);
};

 

public __gc class MyRibbonTabProxy
{
 private:
  RibbonTab*  m_RibTab;
 public:
  MyRibbonTabProxy(String* title, String* id );

};

 

void MakeIt()
{
 MyRibbonTabProxy* rb = new MyRibbonTabProxy( S"CadOfiTec", S"CadOfiTecTab" );
}

 

bool AutoCADCommandHandler::CanExecute(Object* parameter)
{
 return true;
}

void AutoCADCommandHandler::Execute(Object* parameter)
{
 RibbonButton* ribBtn =
  static_cast<Autodesk::Windows::RibbonButton*> (parameter);
 Autodesk::AutoCAD::ApplicationServices::Application:: DocumentManager
  ->MdiActiveDocument->SendStringToExecute(
  static_cast<System::String*>(ribBtn->CommandParameter), false, false, false );
}

 

MyRibbonTabProxy::MyRibbonTabProxy(String* title, String* id )
{

 RibbonControl* ribCtrl = Autodesk::Windows::ComponentManager::Ribbon;
 if( ribCtrl == NULL )
  return;

 m_RibTab =  ribCtrl->FindTab( id );
 if( m_RibTab != NULL )
  return;

 m_RibTab = new RibbonTab();
 m_RibTab->Title = title;
 m_RibTab->Id = id;
 ribCtrl->Tabs->Add( m_RibTab );
 m_RibTab->IsActive = true;

 // Create the panel source
 RibbonPanelSource* ribSourcePanel = new RibbonPanelSource();
 ribSourcePanel->Title = "Bloques";
 
 RibbonPanel* ribPanel = new RibbonPanel;
 ribPanel->Source = ribSourcePanel;
 m_RibTab->Panels->Add( ribPanel );
 
 // Create a button
 RibbonButton* ribButton1 = new RibbonButton();
 ribButton1->Text = S"AddTE";
 ribButton1->ShowText = true;
 AutoCADCommandHandler* ch = new AutoCADCommandHandler();
 ribButton1->CommandHandler = ch;
 ribSourcePanel->Items->Add( ribButton1 );

}

Hope It help you.

 

Regards,

Adolfo

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report