.NET

Reply
*Tony Tanzillo
Message 1 of 10 (282 Views)

Can any one else reproduce this?

282 Views, 9 Replies
07-24-2006 04:24 PM
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
*Paul Richardson
Message 2 of 10 (282 Views)

Re: Can any one else reproduce this?

07-24-2006 04:54 PM in reply to: *Tony Tanzillo
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
*Tony Tanzillo
Message 3 of 10 (282 Views)

Re: Can any one else reproduce this?

07-24-2006 05:43 PM in reply to: *Tony Tanzillo
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
*Bob
Message 4 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 10:21 AM in reply to: *Tony Tanzillo
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
*Tony Tanzillo
Message 5 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 11:47 AM in reply to: *Tony Tanzillo
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
*Gaston Nunez
Message 6 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 12:52 PM in reply to: *Tony Tanzillo
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
*Tony Tanzillo
Message 7 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 12:53 PM in reply to: *Tony Tanzillo
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
*Mark Johnston
Message 8 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 01:44 PM in reply to: *Tony Tanzillo
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
*Mark Johnston
Message 9 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 02:01 PM in reply to: *Tony Tanzillo
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
*Tony Tanzillo
Message 10 of 10 (282 Views)

Re: Can any one else reproduce this?

07-25-2006 06:37 PM in reply to: *Tony Tanzillo
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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.