Author Topic: dlls in autocad 64 bits  (Read 954 times)

0 Members and 1 Guest are viewing this topic.

efernal

  • Newt
  • Posts: 198
dlls in autocad 64 bits
« on: October 21, 2010, 10:15:03 AM »
Please,
Does the dll's compiled with mvs2008 32bits run in autocad 64 bits?

e.fernal
e.fernal

sinc

  • Guest
Re: dlls in autocad 64 bits
« Reply #1 on: October 21, 2010, 10:32:40 AM »
It depends.  Most things should work fine, as long as they use the .NET managed libraries to interact with Autocad.  If you're doing things like PInvoke or using any Interops to interact with Autocad, you'll have issues.

Your DLLs should also in theory work on later versions of Autocad, as long as you aren't using PInvoke or the Interops, but there's qualifiers on that, too.  From time to time, Autodesk will make a change to the structure of Autocad that may be reflected in a change to the API, which may require something to be rewritten in your app.  You may also have sundry other issues.  I think I remember seeing something about an issue with "Int"s that caused a compatibility issue with 2011, preventing DLLs compiled for earlier versions of Autocad from working in 2011, but was resolved in the service pack (I think... I didn't read too carefully about that issue...).

efernal

  • Newt
  • Posts: 198
Re: dlls in autocad 64 bits
« Reply #2 on: October 21, 2010, 12:26:49 PM »
Thanks, Sinc...
Actually, it's a very simple autolisp function (bellow)

Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.DatabaseServices

Public Class Class1

    Public Declare Function C500 Lib "C:\GrMetal\Lisp\C50032.DLL" (ByVal senha As String) As Int32

    <LispFunction("Gr_Metal_Dongle")> _
    Public Function Read_Dongle(ByVal mArgs As ResultBuffer) As ResultBuffer

        Dim impede As Int16 '' impede will be 1 or 0

        impede = 1 ''

        If Dir("C:\Gr12000\Lisp\C50032.dll") <> "" Then

            Dim i, j As Int16
            Dim A As String = ""
            ''
            i = -7
            j = -7
            A = Chr(3) & "07K16TL77"
            j = C500(A)
            ''
            If j = 0 Then i = j
            ''
            If i = 0 Then
                Dim tam As Int32
                tam = Len(A)
                A = Mid(A, 2, 8)
                ''
                If A = "Lt3Z124%" Then
                    impede = 0 '' ok, free to work...
                Else
                    impede = 1 '' sinalizes to (exit) autolisp function...
                End If
            Else
                impede = 1     '' sinalizes to (exit) autolisp function...
            End If
        Else
            impede = 1         '' dll not found? -> Exit then
        End If

        If impede = 1 Then
            MsgBox("Atenção:" & vbCrLf & vbCrLf & vbTab & _
                    "Verifique se o hard-lock do Gr-Acad está conectacdo!" & vbTab & vbCrLf & vbTab & _
                    "O aplicativo só pode funcionar com a presença do mesmo!" & vbTab & vbCrLf, _
                    MsgBoxStyle.Critical, "Gr_Metal")
        End If

        '' Retorna para o Autolisp
        Dim mArgs1 As ResultBuffer
        mArgs1 = New ResultBuffer(New TypedValue(CInt(LispDataType.Int16), impede))

        Return mArgs1

    End Function

    '' ///////////////////////////////////////////////////////////////////////////// ''

End Class
e.fernal