TheSwamp

Code Red => .NET => Topic started by: Peter Guappa on November 06, 2011, 02:10:32 PM

Title: netload dll with arguments
Post by: Peter Guappa on November 06, 2011, 02:10:32 PM
I want to know how to use netload with arguments to pass to a dll, and get the results from the dll back to lisp.
Could somebody help me a little example?


lisp:
(defun C:test (a b c)
  (setq a (getint)
        b (getint))

  // (setq c (+ a b)) - I want to use a dll here, only to excercise working with dll, and to learn the interaction between lisp and VB.net with netload !!!!
  // So I want to calculate 'c' with a dll and send the result back to Lisp.
  // netload dll with arguments HERE

  (princ (strcat "\nresult =" (itoa c)))
  (princ)
  );defun
(princ)



VB dll - What do I have to add in my dll to get the arguments passed by lisp/netload

Imports System.Runtime.InteropServices
Imports System.Security.Permissions.SecurityPermission
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Public Class Class1
    Dim a As Integer
    Dim b As Integer
    Dim c As Integer = a + b
End Class

How do I get var c back to lisp?

Thx
Title: Re: netload dll with arguments
Post by: Kerry on November 06, 2011, 02:55:58 PM
The ResultBuffer is the mechanism you use.

A search here ( and elsewhere) will give you some ideas.
http://www.theswamp.org/index.php?topic=35714.msg409451#msg409451
Title: Re: netload dll with arguments
Post by: Peter Guappa on November 06, 2011, 07:31:00 PM
Thx. It works.

The ResultBuffer is the mechanism you use.

A search here ( and elsewhere) will give you some ideas.
http://www.theswamp.org/index.php?topic=35714.msg409451#msg409451