Author Topic: Upgrade VS project to x64 ?  (Read 7390 times)

0 Members and 2 Guests are viewing this topic.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #15 on: July 18, 2010, 02:13:32 AM »
Luis wouldn't you need to reference the 64x version of acdbmgd and acmgd.DLL?

There is no "64x version" of the managed libraries.

One of the neat things about working with .NET is that the CIL is independent of the underlying architecture.  So as long as you aren't trying to reference the Interops and use COM stuff, and as long as you aren't doing any PInvoke stuff, you can pretty much ignore x86 vs. x64.
now just started to be more confused... I'll check tomorrow...

Hi Sinc,
 any idea why they have two different (if they are) files, have a look in the the x64: and also there is a 32 folder..................................................

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Upgrade VS project to x64 ?
« Reply #16 on: July 18, 2010, 03:03:24 AM »
Luis, this is what I have on my Win7 x64.
Only 2011 Mechanical installed and  SDK's ( 2010, 2011)
Search results for AcMgd* in C:\;  
Quote

AcMgd.dll       c:\ObjectARX 2010\inc-win32                                                                                   727 kB    2009/02/09 00:01  
AcMgd.dll       c:\ObjectARX 2010\inc-x64                                                                                     737 kB    2009/02/09 00:05  
AcMgd.dll       c:\ObjectARX 2011\inc                                                                                         829 kB    2010/02/09 20:10  
acmgd.dll       c:\Program Files\Autodesk\ACADM 2011                                                                          2.55 MB   2010/02/10 14:17  
acmgd           c:\Windows\assembly\NativeImages_v2.0.50727_64                                                                Folder    2010/06/25 13:42  
acmgd.ni.dll    c:\Windows\assembly\NativeImages_v2.0.50727_64\acmgd\87c6ae3a116b3b89b786eb601379bbd7                         7.38 MB   2010/06/25 13:42  


.. and the AcDbMgd
Quote
acdbmgd                 C:\Windows\assembly\NativeImages_v2.0.50727_64                                                                                  Folder      2010/06/25 13:42
AcDbMgd.dll             C:\ObjectARX 2010\inc-win32                                                                                                     1.65 MB     2009/02/08 23:52        
AcDbMgd.dll             C:\ObjectARX 2010\inc-x64                                                                                                       1.67 MB     2009/02/08 23:54        
AcDbMgd.dll             C:\ObjectARX 2011\inc                                                                                                           1.97 MB     2010/02/09 20:03        
acdbmgd.dll             C:\Program Files\Autodesk\ACADM 2011                                                                                            5.69 MB     2010/02/10 14:16        
acdbmgd.lib             C:\Autodesk\AutoCAD_Mechanical_2011_English_Win_64bit\sdk\ObjectARX\lib-win32                                                   5 kB        2010/02/10 11:52        
acdbmgd.lib             C:\Autodesk\AutoCAD_Mechanical_2011_English_Win_64bit\sdk\ObjectARX\lib-x64                                                     5 kB        2010/02/10 12:01        
acdbmgd.lib             C:\ObjectARX 2010\lib-win32                                                                                                     5 kB        2009/02/08 23:50        
acdbmgd.lib             C:\ObjectARX 2010\lib-x64                                                                                                       5 kB        2009/02/08 23:53        
acdbmgd.lib             C:\ObjectARX 2011\lib-win32                                                                                                     5 kB        2010/02/09 19:52        
acdbmgd.lib             C:\ObjectARX 2011\lib-x64                                                                                                       5 kB        2010/02/09 20:01        
acdbmgd.ni.dll          C:\Windows\assembly\NativeImages_v2.0.50727_64\acdbmgd\aa0870e6051189eb524d52e8cf8277c4                                         14.24 MB    2010/06/25 13:42
acdbmgd.resources.dll   C:\Program Files\Autodesk\ACADM 2011\en-US                                                                                      264 kB      2010/02/10 14:16        
  
acdbmgdbrep.dll         C:\ObjectARX 2010\inc-win32                                                                                                     132 kB      2009/02/08 23:57        
acdbmgdbrep.dll         C:\ObjectARX 2010\inc-x64                                                                                                       140 kB      2009/02/09 00:00        
acdbmgdbrep.dll         C:\ObjectARX 2011\inc                                                                                                           140 kB      2010/02/09 20:07        
acdbmgdbrep.dll         C:\Program Files\Autodesk\ACADM 2011                                                                                            144 kB      2010/02/09 22:16    

So It looks like the 32/64 bit versions are different for 2010
« Last Edit: July 18, 2010, 03:26:12 AM by Kerry Brown »
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.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: Upgrade VS project to x64 ?
« Reply #17 on: July 18, 2010, 06:12:01 AM »
sinc's right...besides the occasional goof, I.e. a function call that returns an Int32 on 32bit machine and an Int64 on x64, it shouldn't matter what version you reference, your code will always be Jitted with the module Acad has loaded.

There are 32bit, 64bit versions of these modules only because of the unmanaged portion, but that's all stuff you can't access anyway.

Now if somewhere in your project, your referencing a 32bit COM and trying to use it in a 64bit process, that will cause things to fail.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #18 on: July 18, 2010, 09:59:48 AM »
So It looks like the 32/64 bit versions are different for 2010

Thank you Kerry.

Same conclusion here.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #19 on: July 19, 2010, 12:50:13 AM »
...so, have to become more familiar with x64 that it is somehow new to me, was using xp win32 for a long time...
got this laptop with windows vista home premium

downloaded from here some x64 files, and will tried to see how they load or work... (did not found a dbx/arx x64 from a custom object build, anyone have one?)

one interesting part, that i found out, is that did a test with one of my custom objects that also have a com wrapper (for the properties palette)
build it for x64 - no errors - and once it is loaded an error it is shown on the line command: Failed to register COM server (admin privileges, needed? Regsvr32.exe?)
but still all works, the arx companion it is loaded and all the commands works..... :?
« Last Edit: July 19, 2010, 12:56:25 AM by LE3 »

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #20 on: July 22, 2010, 11:55:31 AM »
I have been able to resolved most of my issues.

OS Win.Vista.Home.Premium.x64

1. For the COM wrapper(DBX) to be register it is required to disable the: User Account Control (UAC) (a tip I got from the adesk arx forum, and that I have no idea at all, was for so many years in the win32 arena...).

2. Make sure to use the assemblies from the ARX SDK and target to x64!, and for the Autodesk.AutoCAD.Interop.Common.dll and Autodesk.AutoCAD.Interop.dll
use the 'browse' when doing the reference, not the COM tab.

3. For COM calls in your solution like:
Code: [Select]
AcadApplication acAppCOMObj = Application.AcadApplication as AcadApplication;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
    DBObject obj = tr.GetObject(res.ObjectId, OpenMode.ForRead);
    ObjEnt = acAppCOMObj.ActiveDocument.HandleToObject(obj.Handle.ToString());
    tr.Commit();
}
Can be replace by:
Code: [Select]
using (Transaction tr = db.TransactionManager.StartTransaction())
{
      DBObject obj = tr.GetObject(res.ObjectId, OpenMode.ForRead, false) as DBObject;
      if (obj != null)
      {
           ObjEnt = obj.AcadObject; //<<=
     }
      tr.Commit();
}

4. There were some other calls in my code, that work in win32 but not in x64, I will try to document that, and once I get the chance to posted here, when possible.

5. Still I have the issue to focus to AutoCAD drawing area, after clicking a button from a modeless form, to make a selection (via GetEntity), when you get the cross hairs, instead of the pick box, so you have to make a click first to make the focus and then be able to do the selection, what it is interesting is that if you do this from a debug session, you don't see this issue... hmm

Have tried, with - no success:
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView();
SetFocus(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Handle);
SetForegroundWindow(Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Handle);

mwrfdot

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #21 on: July 23, 2010, 01:40:24 PM »
You may also need to set your Advanced Compile Settings to target "AnyCPU" (the default is 32bit), if you are progamming only in .NET this will allow your app on either 32bit or 64bit ACad/Windows.