Hi.
I'm trying to access a simple vb component thru ActiveX. It is just a simple test of connect to a VB Component, but I can't get it right.
This is the Visual Basic Code...
Public Function StrConcat(str1 As String, str2 As String) As Variant StrConcat = (str1) & (str2)
End Function
....and this is the VLisp Code:
(vl-load-com)
(defun vbStrCat (string1 string2 / $acad vbstrcls out)
(setq $acad (vlax-get-acad-object))
(setq vbstrcls
(vla-GetInterfaceObject $acad "vbStringClass.vbStrings")) (setq out (vlax-invoke-method vbstrcls "StrConcat" string1 string2)) out (vlax-release-object vbstrcls) (vlax-release-object $acad)
)
So, when i load and call it from Autocad command line (vbStrCat "test1" "teste2"), it gives me this text: "#<variant 8 >".
Does anybody knows where is the error and how to fix it ?
Thanks a lot.
I'm trying to access a simple vb component thru ActiveX. It is just a simple test of connect to a VB Component, but I can't get it right.
This is the Visual Basic Code...
Public Function StrConcat(str1 As String, str2 As String) As Variant StrConcat = (str1) & (str2)
End Function
....and this is the VLisp Code:
(vl-load-com)
(defun vbStrCat (string1 string2 / $acad vbstrcls out)
(setq $acad (vlax-get-acad-object))
(setq vbstrcls
(vla-GetInterfaceObject $acad "vbStringClass.vbStrings")) (setq out (vlax-invoke-method vbstrcls "StrConcat" string1 string2)) out (vlax-release-object vbstrcls) (vlax-release-object $acad)
)
So, when i load and call it from Autocad command line (vbStrCat "test1" "teste2"), it gives me this text: "#<variant 8 >".
Does anybody knows where is the error and how to fix it ?
Thanks a lot.