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

Can any one else reproduce this?

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
551 Views, 9 Replies

Can any one else reproduce this?

I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

Here's what I got; that's not good.

Failed to create component 'UserControl1'. The error message follows:
'System.IO.FileNotFoundException: Could not load file or assembly 'acmgd,
Version=17.0.54.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot find the
file specified.
File name: 'acmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'
at CsMgdAcad2.UserControl1.UserControl1_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at
System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(Control
newChild)
at System.Windows.Forms.Design.ParentControlDesigner.AddControl(Control
newChild, IDictionary defaultValues)
at
System.Windows.Forms.Design.ControlDesigner.InitializeNewComponent(I...'


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 3 of 10
Anonymous
in reply to: Anonymous

Thanks.

I've gotten a variety of different errors, here's one:


Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )
at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()
at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)
at .LanguageSupport.InitializePerProcess(LanguageSupport* )
at .LanguageSupport._Initialize(LanguageSupport* )
at .LanguageSupport.Initialize(LanguageSupport* )



--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message news:5246899@discussion.autodesk.com...
Here's what I got; that's not good.

Failed to create component 'UserControl1'. The error message follows:
'System.IO.FileNotFoundException: Could not load file or assembly 'acmgd,
Version=17.0.54.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot find the
file specified.
File name: 'acmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'
at CsMgdAcad2.UserControl1.UserControl1_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at
System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(Control
newChild)
at System.Windows.Forms.Design.ParentControlDesigner.AddControl(Control
newChild, IDictionary defaultValues)
at
System.Windows.Forms.Design.ControlDesigner.InitializeNewComponent(I...'


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 4 of 10
Anonymous
in reply to: Anonymous

what does this do for you?

if( false )
{
Document doc = null;
}

i'm curious


"Tony Tanzillo" wrote in message
news:5246936@discussion.autodesk.com...
Thanks.

I've gotten a variety of different errors, here's one:


Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )
at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()
at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)
at .LanguageSupport.InitializePerProcess(LanguageSupport* )
at .LanguageSupport._Initialize(LanguageSupport* )
at .LanguageSupport.Initialize(LanguageSupport* )



--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message
news:5246899@discussion.autodesk.com...
Here's what I got; that's not good.

Failed to create component 'UserControl1'. The error message follows:
'System.IO.FileNotFoundException: Could not load file or assembly 'acmgd,
Version=17.0.54.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot find the
file specified.
File name: 'acmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'
at CsMgdAcad2.UserControl1.UserControl1_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at
System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(Control
newChild)
at System.Windows.Forms.Design.ParentControlDesigner.AddControl(Control
newChild, IDictionary defaultValues)
at
System.Windows.Forms.Design.ControlDesigner.InitializeNewComponent(I...'


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 5 of 10
Anonymous
in reply to: Anonymous

It does nothing.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Bob" wrote in message news:5247705@discussion.autodesk.com...
what does this do for you?

if( false )
{
Document doc = null;
}

i'm curious


"Tony Tanzillo" wrote in message
news:5246936@discussion.autodesk.com...
Thanks.

I've gotten a variety of different errors, here's one:


Attempted to read or write protected memory.
This is often an indication that other memory is corrupt.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )
at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()
at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)
at .LanguageSupport.InitializePerProcess(LanguageSupport* )
at .LanguageSupport._Initialize(LanguageSupport* )
at .LanguageSupport.Initialize(LanguageSupport* )



--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message
news:5246899@discussion.autodesk.com...
Here's what I got; that's not good.

Failed to create component 'UserControl1'. The error message follows:
'System.IO.FileNotFoundException: Could not load file or assembly 'acmgd,
Version=17.0.54.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. The system cannot find the
file specified.
File name: 'acmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'
at CsMgdAcad2.UserControl1.UserControl1_Load(Object sender, EventArgs e)
at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
at System.Windows.Forms.UserControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.ControlCollection.Add(Control value)
at System.Windows.Forms.Form.ControlCollection.Add(Control value)
at
System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(Control
newChild)
at System.Windows.Forms.Design.ParentControlDesigner.AddControl(Control
newChild, IDictionary defaultValues)
at
System.Windows.Forms.Design.ControlDesigner.InitializeNewComponent(I...'


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 6 of 10
Anonymous
in reply to: Anonymous

Tony:

I have this:

---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'UserControl1'. The error message follows:

'.ModuleLoadException: The C++ module failed to
load during process initialization.
---> System.Runtime.InteropServices.SEHException: External component has
thrown an exception.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )

at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()

at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)

at
.LanguageSupport.InitializePerProcess(LanguageSupport*
)

at
.LanguageSupport._Initialize(LanguageSupport* )

at
.LanguageSupport.Initialize(LanguageSupport* )

--- End of inner exception stack trace ---

at .ThrowModuleLoadException(String
errorMessage, Exception innerException) in
f:\rtm\vctools\crt_bld\self_x86\crt\src\minternal.h:line 224

at .ThrowModuleLoadException(String ,
Exception )

at
.LanguageSupport.Initialize(LanguageSupport* )

at .cctor()'
---------------------------
OK
---------------------------


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 7 of 10
Anonymous
in reply to: Anonymous

Thanks.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Gaston Nunez" wrote in message news:5248003@discussion.autodesk.com...
Tony:

I have this:

---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'UserControl1'. The error message follows:

'.ModuleLoadException: The C++ module failed to
load during process initialization.
---> System.Runtime.InteropServices.SEHException: External component has
thrown an exception.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )

at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()

at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)

at
.LanguageSupport.InitializePerProcess(LanguageSupport*
)

at
.LanguageSupport._Initialize(LanguageSupport* )

at
.LanguageSupport.Initialize(LanguageSupport* )

--- End of inner exception stack trace ---

at .ThrowModuleLoadException(String
errorMessage, Exception innerException) in
f:\rtm\vctools\crt_bld\self_x86\crt\src\minternal.h:line 224

at .ThrowModuleLoadException(String ,
Exception )

at
.LanguageSupport.Initialize(LanguageSupport* )

at .cctor()'
---------------------------
OK
---------------------------


"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 8 of 10
Anonymous
in reply to: Anonymous

Tony,
When I got to step 9 and went to rebuild the solution I got this error.

Error 2 The type 'Autodesk.AutoCAD.Runtime.DisposableWrapper' is defined in
an assembly that is not referenced. You must add a reference to assembly
'acdbmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'.
M:\Programming\Projects\ACAD_Development\DotNET\TonyTest\TonyTest\UserControl1.cs
23 17 TonyTest

I only added the reference to acmgd.dll as per your instructions. Should
there also be a reference to acdbmgd.dll?

=Mark

"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 9 of 10
Anonymous
in reply to: Anonymous

Added acdbmgd.dll reference and . . .

---------------------------
Microsoft Visual Studio
---------------------------
Failed to create component 'UserControl1'. The error message follows:

'.ModuleLoadException: The C++ module failed to
load during process initialization.
---> System.Runtime.InteropServices.SEHException: External component has
thrown an exception.

at AcPlPlotReactor.{ctor}(AcPlPlotReactor* )

at ?A0x196ef274.??__EgPlotReactor@@YMXXZ()

at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)

at
.LanguageSupport.InitializePerProcess(LanguageSupport*
)

at
.LanguageSupport._Initialize(LanguageSupport* )

at
.LanguageSupport.Initialize(LanguageSupport* )

--- End of inner exception stack trace ---

at .ThrowModuleLoadException(String
errorMessage, Exception innerException) in
f:\rtm\vctools\crt_bld\self_x86\crt\src\minternal.h:line 224

at .ThrowModuleLoadException(String ,
Exception )

at
.LanguageSupport.Initialize(LanguageSupport* )

at .cctor()'
---------------------------
OK
---------------------------



"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
Message 10 of 10
Anonymous
in reply to: Anonymous

Sorry, I neglected to mention that you
also need to reference acdbmgd.dll.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Mark Johnston" wrote in message news:5248087@discussion.autodesk.com...
Tony,
When I got to step 9 and went to rebuild the solution I got this error.

Error 2 The type 'Autodesk.AutoCAD.Runtime.DisposableWrapper' is defined in
an assembly that is not referenced. You must add a reference to assembly
'acdbmgd, Version=17.0.54.0, Culture=neutral, PublicKeyToken=null'.
M:\Programming\Projects\ACAD_Development\DotNET\TonyTest\TonyTest\UserControl1.cs
23 17 TonyTest

I only added the reference to acmgd.dll as per your instructions. Should
there also be a reference to acdbmgd.dll?

=Mark

"Tony Tanzillo" wrote in message
news:5246882@discussion.autodesk.com...
I've identified a fairly nasty issue in managed
extensions for AutoCAD 2007. I'd be interested
in hearing from Autodesk about it, or anyone
who cares to try this.

1. Open VS2005 and create a new solution
with a C# ClassLibrary project (optionally,
you can use the Autodesk-provided C#
project wizard). Delete the Class1 class
from the project.

2. In the ClassLibrary project, add a reference
to acmgd.dll (for debugging you need to
set CopyLocal to false, but for this it does
not matter what it's set to).

3. Add a new Form the project, using the
default name 'Form1'.

4. Add a new UserControl to the project
using the default name 'UserControl1'.

5. Open UserControl1.cs, and add the
following using directive:

using Autodesk.AutoCAD.ApplicationServices;

6. Build the solution.

7. Open UserControl1 in the designer. On the
Events tab of the properties pane, add a
handler for the UserControl's Load event,
using the default name 'UserControl1_Load'.

8. In the body of UserControl1_Load(), add the
following code (the Document type is from
Autodesk.AutoCAD.ApplicationServices).

if( false )
{
Document doc = null;
}

Note that the above code is unreachable and
you will get a warning as a result, which you
should ignore. This is done deliberately to
ensure the code never executes in the IDE.

9. Rebuild the solution, and ignore the warnings
about unreachable code, or that the doc variable
is assigned but never used.

10. Open Form1 in the designer, and from the Toolbox,
insert an instance of UserControl1 onto Form1.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost