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

0 Members and 1 Guest are viewing this topic.

LE3

  • Guest
Upgrade VS project to x64 ?
« on: July 17, 2010, 04:51:08 PM »
I have a visual studio C# project, that runs in win32 AutoCAD 2010 (A2007,8,9) and now got the chance to do the upgrade
to x64 (have now a x64 system with AutoCAD 2010 installed to run my tests).

I do not see anywhere the reference COM "AutoCAD/ObjectDBX/Common XX Type Library" (I have on my project this one: AutoCAD/ObjectDBX/Common 18 Type Library)

I see under: D:\ObjectARX 2010\inc-x64 two .tbl files ( axdb18enu.tlb acax18ENU.tlb) and the same ones here: C:\Program Files\Common Files\Autodesk Shared

Totally confused, have tried to add both tbl files, also these ones: Autodesk.AutoCAD.Interop.dll Autodesk.AutoCAD.Interop.Common.dll (under D:\ObjectARX 2010\inc-x64)

and appear that I don't have any luck...

What do you guys do?

Thanks!

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Upgrade VS project to x64 ?
« Reply #1 on: July 17, 2010, 07:00:21 PM »
Luis wouldn't you need to reference the 64x version of acdbmgd and acmgd.DLL?
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #2 on: July 17, 2010, 07:09:29 PM »
Luis wouldn't you need to reference the 64x version of acdbmgd and acmgd.DLL?
Yes, I have those (I assume that those two assemblies are x64, since my laptop is 64 bits... or? )- but my code that works on win32 does not display one of the dialogs....
Here it is a snapshot of my references... if helps in any way:

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: Upgrade VS project to x64 ?
« Reply #3 on: July 17, 2010, 08:38:19 PM »
Luis wouldn't you need to reference the 64x version of acdbmgd and acmgd.DLL?

No, programmers should always reference the managed DLLs that come with the ARX SDK, usually in the \inc folder. These DLLS are specifically designed for this purpose

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #4 on: July 17, 2010, 08:44:45 PM »
Luis wouldn't you need to reference the 64x version of acdbmgd and acmgd.DLL?

No, programmers should always reference the managed DLLs that come with the ARX SDK, usually in the \inc folder. These DLLS are specifically designed for this purpose
I use those (noticed the capital letters that means were referenced from the sdk...), and also tried the ones from where acad it is installed... no worky in my case.... should I register the x64 tbl's so it can be (maybe) avail in the com tab?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: Upgrade VS project to x64 ?
« Reply #5 on: July 17, 2010, 08:52:28 PM »
Oops sorry, I should have read your post all the way through, you would think those would have been installed with Acad. I'd do a repair of the install

.. let me check mine

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8718
  • AKA Daniel
Re: Upgrade VS project to x64 ?
« Reply #6 on: July 17, 2010, 08:58:10 PM »
Don't know LE, its not on mine either  :-o

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #7 on: July 17, 2010, 09:05:49 PM »
Don't know LE, its not on mine either  :-o

will try to register the tlb and see what happens (it is inside of ObjectARX 2010\inc-x64).

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Upgrade VS project to x64 ?
« Reply #8 on: July 17, 2010, 09:31:20 PM »

flying past, haven't read the whole thread

does this piccy help



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.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #9 on: July 17, 2010, 09:44:23 PM »

flying past, haven't read the whole thread

does this piccy help
I have use that one, will double check and try again... have you used that in any of your x64 code?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Upgrade VS project to x64 ?
« Reply #10 on: July 17, 2010, 09:50:40 PM »

Haven't done any COM stuff on 64bit yet Luis
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.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #11 on: July 17, 2010, 09:57:02 PM »

Haven't done any COM stuff on 64bit yet Luis
Thank you Kerry.

I just added the assembly (from SDK 2010) and does not work.... for me.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Upgrade VS project to x64 ?
« Reply #12 on: July 17, 2010, 11:13:45 PM »

Luis,
Can you clarify what you mean by 'does not work' ??

Which OS are you using ?

What ActiveX Types and Methods are you trying to access ?
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.

LE3

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #13 on: July 17, 2010, 11:31:17 PM »
Which OS are you using ?
Microsoft Windows NT Version 6.0 (x64)
Acadver: 18.0s (LMS Tech)

Quote
What ActiveX Types and Methods are you trying to access ?

To give you an idea, was thinking to try/move/use simple .net instead of those COM calls/usage... will give it a try

Code: [Select]
public static Node SelectEntityProperty(bool bSelect)
{
try
{

if (CXCELClass.gCReportTemplate != null && CXCELClass.gCReportTemplate.gfrmReport != null &&
!CXCELClass.gCReportTemplate.gfrmReport.IsDisposed)
CXCELClass.gCReportTemplate.gfrmReport.Visible = false;
#if !COM_APP
Document doc = Application.DocumentManager.MdiActiveDocument;
if (doc == null)
{
System.Windows.Forms.MessageBox.Show("No opened drawing found.", "Error finding drawing.",
System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
return null;
}
Editor ed = doc.Editor;
           
           
Object ObjEnt;
AcadApplication acAppCOMObj = Application.AcadApplication as AcadApplication;
//Microsoft.VisualBasic.Interaction.AppActivate(Application.MainWindow.Text);
// Ask the user to select an entity
PromptEntityOptions opt = new PromptEntityOptions("\nSelect entity: ");
PromptEntityResult res;
   
while ((res = ed.GetEntity(opt)).Status != PromptStatus.OK){
if (res.Status == PromptStatus.Cancel)
return(null);
}
ed.WriteMessage("\nCommand: ");
Transaction tr = doc.TransactionManager.StartTransaction();
using (tr)
{
DBObject obj = tr.GetObject(res.ObjectId, OpenMode.ForRead);
ObjEnt = acAppCOMObj.ActiveDocument.HandleToObject(obj.Handle.ToString());

tr.Commit();
}
Node nod = new Node();
frmObjProp frm = new frmObjProp(bSelect);
CadxcelNET.CXCELClass.GetMainForm().frmPropExplorer = frm;
frm.treeObjProp.Nodes.Add(nod);
SetDatPropObj(ObjEnt, nod);
nod.Expand();
frm.ShowDialog();
if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
return frm.treeObjProp.SelectedNode;
else
return null;
#else
AcadApplication acAppCOMObj = Application.AcadApplication as AcadApplication;
AcadDocument acDocCOMObj;
Object objEnt = null;
Object objPoint;
           
string strRes = "Yes";

if (acAppCOMObj != null)
{

acDocCOMObj = acAppCOMObj.ActiveDocument;
               
//Microsoft.VisualBasic.Interaction.AppActivate(acAppCOMObj.Caption);
while (objEnt == null && strRes.CompareTo("Yes") == 0)
{
try
{

acDocCOMObj.Utility.GetEntity(out objEnt, out objPoint, "\nSelect Entity:");
}
catch
{
acDocCOMObj.Utility.InitializeUserInput(1, "Yes No");
strRes = acDocCOMObj.Utility.GetKeyword("Nothing selected. Continue?(Yes/No):");
}
}
if (objEnt == null)
return(null);

Node nod = new Node();
frmObjProp frm = new frmObjProp(true);
frm.treeObjProp.Nodes.Add(nod);
SetDatPropObj(objEnt, nod);
nod.Expand();
frm.ShowDialog();
if (frm.DialogResult == System.Windows.Forms.DialogResult.OK)
return frm.treeObjProp.SelectedNode;
else
return null;
               
}

#endif
}
catch{}
finally
{
if (CXCELClass.gCReportTemplate != null && CXCELClass.gCReportTemplate.gfrmReport != null &&
!CXCELClass.gCReportTemplate.gfrmReport.IsDisposed)
CXCELClass.gCReportTemplate.gfrmReport.Visible = true;
}
return null;
        }

sinc

  • Guest
Re: Upgrade VS project to x64 ?
« Reply #14 on: July 18, 2010, 01:50:46 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.