G
Guest
I'm testing AutoCAD 2005 automation via VS2005 Pro C++/CLR and I'm getting
fatal compiler errors.
I start with a default C++/CLR class library project and modify it by adding
the following references:
acdbmgd.dll
acmgd.dll
the entire source for the default library header file is:
// DotNetBug.h
#pragma once
using namespace System;
typedef Autodesk::AutoCAD::ApplicationServices::CommandLinePrompts CmdLine;
typedef Autodesk::AutoCAD:atabaseServices::Handle Handle;
typedef Autodesk::AutoCAD:atabaseServices:BObject DBObject;
typedef Autodesk::AutoCAD::Runtime::RXClass RXClass;
namespace DotNetBug
{
public ref class Class1 : public
Autodesk::AutoCAD::Runtime::IExtensionApplication
{
public:
virtual void Initialize()
{
CmdLine::Message( System::Convert::ToString( "\nAutoCAD
extensions loaded!\n" ) );
}
virtual void Terminate()
{
CmdLine::Message( System::Convert::ToString( "\nAutoCAD
extensions unloaded!\n" ) );
}
};
public ref class Commands
{
public:
[Autodesk::AutoCAD::Runtime::CommandMethod("hello")]
static void Hello()
{
CmdLine::Message( "\nHello from C++!\n" );
//===============================================
// It seems that any use of the DBObject interface causes
compiler crash
//===============================================
// The following line causes fatal error C1001
DBObject ^o = gcnew DBObject;
DBObject ^p = nullptr;
// The following line causes fatal error C1001
Handle h = p->HHandleHandle;
}
};
}
This is the simplest example I've found to reproduce the error. Both trivial
and more complex use of the DBObject interface compiles and executes as
expected with C#. This would seem to indicate a bug in the C++ compiler.
Has anyone else seem this kind of behavior?
Thanks in advance for any assistance.
fatal compiler errors.
I start with a default C++/CLR class library project and modify it by adding
the following references:
acdbmgd.dll
acmgd.dll
the entire source for the default library header file is:
// DotNetBug.h
#pragma once
using namespace System;
typedef Autodesk::AutoCAD::ApplicationServices::CommandLinePrompts CmdLine;
typedef Autodesk::AutoCAD:atabaseServices::Handle Handle;
typedef Autodesk::AutoCAD:atabaseServices:BObject DBObject;
typedef Autodesk::AutoCAD::Runtime::RXClass RXClass;
namespace DotNetBug
{
public ref class Class1 : public
Autodesk::AutoCAD::Runtime::IExtensionApplication
{
public:
virtual void Initialize()
{
CmdLine::Message( System::Convert::ToString( "\nAutoCAD
extensions loaded!\n" ) );
}
virtual void Terminate()
{
CmdLine::Message( System::Convert::ToString( "\nAutoCAD
extensions unloaded!\n" ) );
}
};
public ref class Commands
{
public:
[Autodesk::AutoCAD::Runtime::CommandMethod("hello")]
static void Hello()
{
CmdLine::Message( "\nHello from C++!\n" );
//===============================================
// It seems that any use of the DBObject interface causes
compiler crash
//===============================================
// The following line causes fatal error C1001
DBObject ^o = gcnew DBObject;
DBObject ^p = nullptr;
// The following line causes fatal error C1001
Handle h = p->HHandleHandle;
}
};
}
This is the simplest example I've found to reproduce the error. Both trivial
and more complex use of the DBObject interface compiles and executes as
expected with C#. This would seem to indicate a bug in the C++ compiler.
Has anyone else seem this kind of behavior?
Thanks in advance for any assistance.