AutoCAD 2005 & VS2005 C++/CLR: fatal error C1001

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::DatabaseServices::Handle Handle;
typedef Autodesk::AutoCAD::DatabaseServices::DBObject 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.
 
T

Tarek Madkour [MSFT]

I'm testing AutoCAD 2005 automation via VS2005 Pro C++/CLR and I'm
getting fatal compiler errors.

Can you post the errors you're getting?

Thanks,
 
G

Guest

1>------ Build started: Project: DotNetBug, Configuration: Debug Win32 ------
1>Copying 'c:\Program Files\AutoCAD 2005\acdbmgd.dll' to target directory...
1>Copying 'c:\Program Files\AutoCAD 2005\acmgd.dll' to target directory...
1>Compiling...
1>Stdafx.cpp
1>Compiling...
1>DotNetBug.cpp
1>c:\tmp\dotnetbug\dotnetbug\DotNetBug.h(43) : fatal error C1001: An
internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1392)
1> To work around this problem, try simplifying or changing the program near
the locations listed above.
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1> This diagnostic occurred while importing type
'Autodesk::AutoCAD::DatabaseServices::DBObject ' from assembly 'acdbmgd,
Version=16.1.63.0, Culture=neutral, PublicKeyToken=7208edf2a10162b1'.
1>Build log was saved at
"file://c:\tmp\DotNetBug\DotNetBug\Debug\BuildLog.htm"
1>DotNetBug - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

DotNetBug.h(43) = "DBObject ^o = gcnew DBObject;" as shown in the example
code. As previously mentioned, it seems that any use of the DBObject
interface causes C1001.
 
G

Guest

1>------ Build started: Project: DotNetBug, Configuration: Debug Win32 ------
1>Copying 'c:\Program Files\AutoCAD 2005\acdbmgd.dll' to target directory...
1>Copying 'c:\Program Files\AutoCAD 2005\acmgd.dll' to target directory...
1>Compiling...
1>Stdafx.cpp
1>Compiling...
1>DotNetBug.cpp
1>c:\tmp\dotnetbug\dotnetbug\DotNetBug.h(43) : fatal error C1001: An
internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1392)
1> To work around this problem, try simplifying or changing the program near
the locations listed above.
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1> This diagnostic occurred while importing type
'Autodesk::AutoCAD::DatabaseServices::DBObject ' from assembly 'acdbmgd,
Version=16.1.63.0, Culture=neutral, PublicKeyToken=7208edf2a10162b1'.
1>Build log was saved at
"file://c:\tmp\DotNetBug\DotNetBug\Debug\BuildLog.htm"
1>DotNetBug - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Line 43 of the source file is "DBObject ^o = gcnew DBObject;".
 
T

Tarek Madkour [MSFT]

1>c:\tmp\dotnetbug\dotnetbug\DotNetBug.h(43) : fatal error C1001: An
internal error has occurred in the compiler.
1>(compiler file 'msc1.cpp', line 1392)
1> To work around this problem, try simplifying or changing the
program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more
information 1> This diagnostic occurred while importing type
'Autodesk::AutoCAD::DatabaseServices::DBObject ' from assembly
'acdbmgd, Version=16.1.63.0, Culture=neutral,
PublicKeyToken=7208edf2a10162b1'. 1>Build log was saved at

[...]

Line 43 of the source file is "DBObject ^o = gcnew DBObject;".

Doh! I didn't notice you already had the error in the title of your
post. Apologies :)

This is obviously a compiler bug. Please report it to Microsoft product
support and we'll be happy to provide you with either an acceptable
workaround or a fix. You will not be charged for the support call since
you're reporting an actual bug.

Thank you for your feedback.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top