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,
''
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