.net 4 change caused the following code to hang (sample from help file)
any documentation on how do fix this?
[DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl)]
extern static private int acedInvoke(IntPtr args, out IntPtr result);
// Helper for acedInvoke()
public static ResultBuffer InvokeLisp(ResultBuffer args, ref int stat)
IntPtr rb = IntPtr.Zero;
stat = acedInvoke(args.UnmanagedObject, out rb);
if (stat == (int)PromptStatus.OK && rb != IntPtr.Zero)
DisposableWrapper.Create(typeof(ResultBuffer), rb, true);
AFAIK, this is not a related to .NET Framework 4.0 but to the AutoCAD 2013 .NET API.
Replace acad.exe with accore.dll, or, better, use the managed Application.Invoke() method which wraps the ObjectARX acedInvoke method (since A2011).
Changing acad.exe to accore.dll worked great!
Most of my routines use this code to access lisp api call data. If you know of any examples using Application.Invoke() that does the same I would learn something new.
As P/Invoking acedInvoke, the Application.Invoke() method requires a single argument as ResultBuffer and returns the LISP return value as a ResultBuffer.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.