Author Topic: .NET acedGetSym / acedPutSym / acedInvoke in Bricscad  (Read 4053 times)

0 Members and 1 Guest are viewing this topic.

squirreldip

  • Newt
  • Posts: 114
.NET acedGetSym / acedPutSym / acedInvoke in Bricscad
« on: November 15, 2013, 02:26:08 AM »
I've been working to convert a number of my highway design tools from LISP to .NET.  I have a fairly extensive lisp library and it's not practical to rewrite the entire library - as such I need to access lisp variables in .NET.

I've been using a the following:

Code: [Select]
        ' Use P/Invoke for acedGetSym
        <DllImport("acCore.dll", CharSet:=CharSet.Unicode, _
               CallingConvention:=CallingConvention.Cdecl, EntryPoint:="acedGetSym")> _
        Shared Function acedGetSym(ByVal args As String, <Out()> ByRef result As IntPtr) As Integer
        End Function

        ' Use P/Invoke for acedPutSym
        <DllImport("acCore.dll", CharSet:=CharSet.Unicode, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="acedPutSym")> _
        Shared Function acedPutSym(ByVal args As String, ByVal result As IntPtr) As Integer
        End Function

        'use P/Invoke for acedInvoke
        <DllImport("acCore.dll", CallingConvention:=CallingConvention.Cdecl, EntryPoint:="acedInvoke")> _
        Private Shared Function acedInvoke(ByVal args As IntPtr, ByRef result As IntPtr) As Integer
        End Function

Which compiles and works well in Autodesk (and thanks to The Swamp for the help with this).

I'd like to modify to use in Bricscad.  I'm assuming the "acCore.dll" will be replaced with "BRX13.dll" but need the new EntryPoint values.  (anything else?)

Thanks for the help in advance!

squirreldip

  • Newt
  • Posts: 114
Re: .NET acedGetSym / acedPutSym / acedInvoke in Bricscad
« Reply #1 on: November 15, 2013, 01:31:16 PM »
I used a DLL viewer to look at BRX13.DLL and it seems the entry points are the same.  Does anyone have any experience with P/Invoke in Bricscad and possibly solution?

exmachina

  • Guest
Re: .NET acedGetSym / acedPutSym / acedInvoke in Bricscad
« Reply #2 on: November 15, 2013, 03:40:31 PM »
Bricscad v13:
BrxMgd.dll

squirreldip

  • Newt
  • Posts: 114
Re: .NET acedGetSym / acedPutSym / acedInvoke in Bricscad
« Reply #3 on: November 17, 2013, 12:37:29 PM »
Thanks for the reply - I'll give it a try (and much simpler than Acad...)