Help to code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Companions!
I am migrating from vb6 to vb.net and need a light to resolve an issue. In vb6, in 32bits architecture I create a dll and inside it my forms which are called via menus created by vb6 itself. Well, let's get to the point.
Now I'm developing for autocad on windows 64bits. Is it possible to reuse the dll created in vb6 and recompile it in VS2017? If the answer is positive, how would the lisp code that invokes commands by the prompt look like?
I will post a call just as an example the way I do this in vb6:
(defun c: mycmd (/ echo * acad * vbcls retval)
(setq echo (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(vl-load-com)
; (setq acadObject (vlax-get-acad-object))
(setq * acad * (vl-catch-all-apply 'vlax-get-acad-object))
(if (not (vl-catch-all-error-p * acad *))
progn
(setq vbcls (vl-catch-all-apply
'vla-GetInterfaceObject
(list * acad * "ProjVB.clsGL"); << clsGL = dll
)
)
(if (not (vl-catch-all-error-p vbcls))
progn
(setq retval (vl-catch-all-apply
'vlax-invoke
(list vbcls "SetAcadApp" * acad *)
)
)
(if (not (vl-catch-all-error-p retval))
progn
(vlax-invoke-method vbcls "Show_myForm"); << form created inside the dll
)
)
)
)
)
)
(if (vl-catch-all-error-p retval)
(vlax-release-object retval)
)
(if (not (= vbcls nil))
(vlax-release-object vbcls)
)
(if (not (= * acad * nil))
(vlax-release-object * acad *)
)
(setvar "CMDECHO" echo)
(princ)
)
If anyone can help me I will be immensely grateful.