.NET

Reply
Valued Contributor
tonofsteel
Posts: 93
Registered: ‎12-04-2009
Message 1 of 3 (405 Views)

COM and .NET -> Files missing, Casting problems

405 Views, 2 Replies
04-17-2012 04:23 PM

I am trying to work through:

 

http://through-the-interface.typepad.com/through_the_interface/2009/05/interfacing-an-external-com-a...

 

I do the following as mentioned in the above post to try get past the casting problem:

 

One thing to mention - I found that the calling application was not able to to cast the returned System.__COMObject to LoadableComponent.INumberAddition unless I updated the project settings to "Register from COM Interop" (near the bottom of the Build tab).

 

As well when I try to build the following error comes up the first time, but not again until I "clean" the project in VS2010:

 

Error 1 Cannot register assembly "C:\Users\User\documents\visual studio 2010\Projects\SimpleBasicTest\SimpleBasicTest\bin\Release\LoadableComponent.dll". Could not load file or assembly 'Acmgd, Version=18.2.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. LoadableComponent

 

 

When I check the version in the ObjectARX 2012\INC\ folder for acmgd.dll it is18.2.51.0.0

 

Where is this elusive 18.2.0.0 version hiding?  I do not have any references to the managed DLL's in my stand alone project, I only have a reference to the AutoCAD Type Library from the COM tab in the add reference dialog.

 

I am guessing my casting problem is from it not being able to find acmgd and hence not registering the assembly for COM interop? Ok fine but how do I shove Visual Studio's face into this DLL?  I tried adding it to the project, adding to the folders where the build is, adding it as a reference, basically anything I could think of.  And why is it insisting on a version that does not even exist?

Valued Mentor
gasty1001
Posts: 450
Registered: ‎04-11-2010
Message 2 of 3 (398 Views)

Re: COM and .NET -> Files missing, Casting problems

04-17-2012 05:34 PM in reply to: tonofsteel

Hi,

 

Did you set the output directory to the one where the acmgd.dll is? It seems that it's a necesary step in order to resolve de dependency on acmgd.cll. This is almost a copy from a comment in the Kean's Blog.

 

Gaston Nunez

Valued Contributor
tonofsteel
Posts: 93
Registered: ‎12-04-2009
Message 3 of 3 (367 Views)

Re: COM and .NET -> Files missing, Casting problems

04-18-2012 08:59 AM in reply to: tonofsteel

When I set the output directory to the AutoCAD folder I get:

 

Error 1 The assembly "C:\Program Files\Autodesk\Acade 2012\LoadableComponent.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'LoadableComponent.Commands, LoadableComponent'. Error: Element not found. LoadableComponent
 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community