By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,947 Members | 1,594 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,947 IT Pros & Developers. It's quick & easy.

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

P: n/a
ARF
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::CommandLin ePrompts 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.
Nov 29 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
=?Utf-8?B?QVJG?= <AR*@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Dec 1 '05 #2

P: n/a
ARF
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.

"Tarek Madkour [MSFT]" wrote:
=?Utf-8?B?QVJG?= <AR*@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.

Dec 1 '05 #3

P: n/a
ARF
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;".

"Tarek Madkour [MSFT]" wrote:
=?Utf-8?B?QVJG?= <AR*@discussions.microsoft.com> wrote in
news:3C**********************************@microsof t.com:
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,
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.

Dec 1 '05 #4

P: n/a
=?Utf-8?B?QVJG?= <AR*@discussions.microsoft.com> wrote in
news:03**********************************@microsof t.com:
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.
--
Tarek Madkour, Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers
no rights.
Dec 2 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.