Author Topic: Dll files are not loaded by Autocad 2011 Windows7 on 64bits  (Read 14866 times)

0 Members and 1 Guest are viewing this topic.

teslaxx

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #15 on: February 07, 2011, 07:59:59 AM »
Hahahahahah  :-D
So funny!!

I attached a mini Project!
On W7 on 32bits, it's working fine.
Now, it seems that Autocad dies if I load the dll file on W7 on 64bits.


Alexander Rivilis

  • Bull Frog
  • Posts: 214
  • Programmer from Kyiv (Ukraine)
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #16 on: February 07, 2011, 09:21:17 AM »
You are using P/Invoke:
Code: [Select]
[DllImport("acad.exe", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedPostCommand@@YAHPB_W@Z")]
        extern static public int acedPostCommand(string strExpr);
First of all check EntryPoint string for AutoCAD x64. It's look like EntryPoint = "?acedPostCommand@@YAHPEB_W@Z"
« Last Edit: February 07, 2011, 09:24:55 AM by Alexander Rivilis »

teslaxx

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #17 on: February 07, 2011, 09:58:01 AM »
Thank you Alex. Now, I can load the .dll file and I can see the menu.
But..
When I enter the command from the menu, it's dies instantly.
When I enter the command in the command menu, it's show "Select the..." and after 1 seconds, it's dies.

Alexander Rivilis

  • Bull Frog
  • Posts: 214
  • Programmer from Kyiv (Ukraine)
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #18 on: February 07, 2011, 10:19:40 AM »
Sorry. I has not AutoCAD x64. That is why I can not test your's code. Try to start transaction AFTER selection of entities.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #19 on: February 08, 2011, 05:04:05 AM »
I haven't looked closely at the code yet ..

Your pre-compiled debug DLL loaded into AC2011 x64

The Menu Loads and can be accessed via Right-Click
I got this while running myMethod after selecting 2 lines.
Quote
************** Exception Text **************
System.MissingMethodException: Method not found: 'Void Autodesk.AutoCAD.DatabaseServices.Entity.IntersectWith(Autodesk.AutoCAD.DatabaseServices.Entity, Autodesk.AutoCAD.DatabaseServices.Intersect, Autodesk.AutoCAD.Geometry.Point3dCollection, Int32, Int32)'.
   at MyNameSpace.Helper.Intersectare(Entity entity1, Entity entity2)
   at MyNameSpace.Helper.myMethod() in C:\Users\iMac\Documents\Visual Studio 2008\Projects\MiniSolution\MiniSolution\Helper.cs:line 54
   at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
   at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
   at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
acdbmgd
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202011/AcdbMgd.DLL
----------------------------------------

Have you tried to debug this yourself ??

« Last Edit: February 08, 2011, 05:10:59 AM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

teslaxx

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #20 on: February 10, 2011, 01:48:34 AM »
I haven't had the time for this problem.
Now, I have :)

I know I receive a similar exception (referring to IntersectWith method) and I changed the references from ObjectARX 2011 to 2010 and it worked.

n.yuan

  • Bull Frog
  • Posts: 348
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #21 on: February 10, 2011, 10:42:50 AM »
Are you saying that in spite using AutoCAD2011, you have to use AutoCAD2010's DLLs as references (because of Win7 64-bit)? It is strange, isn't it?


I haven't had the time for this problem.
Now, I have :)

I know I receive a similar exception (referring to IntersectWith method) and I changed the references from ObjectARX 2011 to 2010 and it worked.

Alexander Rivilis

  • Bull Frog
  • Posts: 214
  • Programmer from Kyiv (Ukraine)
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #22 on: February 10, 2011, 10:53:52 AM »
I haven't had the time for this problem.
Now, I have :)

I know I receive a similar exception (referring to IntersectWith method) and I changed the references from ObjectARX 2011 to 2010 and it worked.
AutoCAD 2011 Update 1.1 must resolve this problem.

teslaxx

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #23 on: February 11, 2011, 06:49:37 AM »
Are you saying that in spite using AutoCAD2011, you have to use AutoCAD2010's DLLs as references (because of Win7 64-bit)? It is strange, isn't it?

No. When I changed the references from ObjectARX 2010 to ObjectARX 2011, I observed that exception when I was using the IntersectWith method.
So, I was received this error, no matter what operating system I was using.

...
Have you tried to debug this yourself ??

I don't have a Windows 7 on 64bits at my disposal. The only thing I can do is asking the person to run my dll. :)



AutoCAD 2011 Update 1.1 must resolve this problem.

I will try your suggestion. :)

Thank You for your responses! :) Have a nice week-end.

deathman20

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #24 on: February 16, 2011, 01:48:57 PM »
Now I have XP 64-bit here running 2010 Mechanical and I ran it and worked no problem.

Mind you its not Win7 and its not 2011.  Though just wanted to say it did work :)

web30

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #25 on: April 19, 2011, 01:17:33 PM »
Are you saying that in spite using AutoCAD2011, you have to use AutoCAD2010's DLLs as references (because of Win7 64-bit)? It is strange, isn't it?

No. When I changed the references from ObjectARX 2010 to ObjectARX 2011, I observed that exception when I was using the IntersectWith method.
So, I was received this error, no matter what operating system I was using.

...
Have you tried to debug this yourself ??

I don't have a Windows 7 on 64bits at my disposal. The only thing I can do is asking the person to run my dll. :)



AutoCAD 2011 Update 1.1 must resolve this problem.

I will try your suggestion. :)

Thank You for your responses! :) Have a nice week-end.



Did this issue get resolved? I'm having the exact same problem. I've tried everything everyone has suggested, up to the AutoCAD 2011 update and recompiling with the 2011 objectARX, which will be the next step for me.

Thanks..

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #26 on: April 19, 2011, 02:34:23 PM »
Hi,

Isn't this related to the fact the Entity.IntersectWith() method has different signatures for 32 and 64 bit platforms ?
The Entity.IntersectWith() two last arguments are typed as Int32 on 32 bit and Int64 on 64 bits.

Tony Tanzillo provided a 'PlatformCompatibilityExtensionMethods' static class to insure a compatible method: C# and VB.
Speaking English as a French Frog

web30

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #27 on: April 19, 2011, 02:57:52 PM »
I don't have Entity.IntersectWith() in my code. My dll does, however run under 32 bits on XP with AutoCAD 2010, but the same code gives me "unknown command" when run under 64bit on Windows7 and AutoCAD 2011.

web30

  • Guest
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #28 on: April 19, 2011, 04:12:48 PM »
I'm attaching a copy of the code. I tried the AutoCAD update, but that didn't make a difference. I also tried both the 2010 and 2011 ObjectARX references; it doesn't make a difference.

I am compiling with Vis Studio 2008 on 32bit XP machine. My client is running W7, 64-bit 2011 AutoCAD Mechanical with update 1 (which includes update 1.1 for AutoCAD). I have access to a test machine that's running XP, AutoCAD 2011 (not mechanical), 32 bit, and this code works on that machine, compiled with ObjectARX 2010.

This code is copied from the video that shows how to convert VBA to VB.Net; it's in several places on the web. And it works on my test machine, but not on my client's machine.

The specific line of code that's creating the error is:

aDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument

If I comment out that line, recompile, netload my dll, and type TST, I get "This is a TST command". However, the BeginCommand and EndCommand code still don't display Begin and End Command.

If I leave that line in the code, recompile and netload my dll, and type TST, I get "unknown command".

So.. it's got something to do with referencing the acadDocument. But again, it works on my test machine - just not my client's.

Any ideas?

Thanks for your time.

n.yuan

  • Bull Frog
  • Posts: 348
Re: Dll files are not loaded by Autocad 2011 Windows7 on 64bits
« Reply #29 on: April 19, 2011, 07:00:58 PM »
Why you have to use COM API (AcadApplication/AcadDocument) and handle the COM object event? COM API code, not like .NET code that works with both 32-bit and 64-bit system, is bit-specific. Since you develop with 32-bit Acad, it would not run with 64-bit AutoCAD.

You can do what you want (catch event before and after a command is executed) with pure .NET API: Document.CommandWillStart/CommandEnded.

I am pretty much against the propaganda of saying how easy it would be to move VBA code to .NET code. Most of such saying is abuse COM API and does learning AutoCAD .NET API programming bad than good.


I'm attaching a copy of the code. I tried the AutoCAD update, but that didn't make a difference. I also tried both the 2010 and 2011 ObjectARX references; it doesn't make a difference.

I am compiling with Vis Studio 2008 on 32bit XP machine. My client is running W7, 64-bit 2011 AutoCAD Mechanical with update 1 (which includes update 1.1 for AutoCAD). I have access to a test machine that's running XP, AutoCAD 2011 (not mechanical), 32 bit, and this code works on that machine, compiled with ObjectARX 2010.

This code is copied from the video that shows how to convert VBA to VB.Net; it's in several places on the web. And it works on my test machine, but not on my client's machine.

The specific line of code that's creating the error is:

aDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.AcadDocument

If I comment out that line, recompile, netload my dll, and type TST, I get "This is a TST command". However, the BeginCommand and EndCommand code still don't display Begin and End Command.

If I leave that line in the code, recompile and netload my dll, and type TST, I get "unknown command".

So.. it's got something to do with referencing the acadDocument. But again, it works on my test machine - just not my client's.

Any ideas?

Thanks for your time.