Using COM component (ActiveX dll) in visual lisp

Using COM component (ActiveX dll) in visual lisp

Anonymous
Not applicable
938 Views
4 Replies
Message 1 of 5

Using COM component (ActiveX dll) in visual lisp

Anonymous
Not applicable

I have 64 bit ACAD 2016 installed on win7. I am trying to call methods from a COM component (ActiveX dll) in visual lisp. The method on my COM component gets called but the input parameter value is always empty. Can anyone explain why this may be happening.

 

Note if I make the exact same calls through VBA, evrything works fine.

 

Thanks

  

0 Likes
939 Views
4 Replies
Replies (4)
Message 2 of 5

Ranjit_Singh
Advisor
Advisor

@Anonymous wrote:

.......... gets called but the input parameter value is always empty. ...............

  


Does the method need a input parameter? What do you pass for the parameters when you call the method in VBA?

0 Likes
Message 3 of 5

Anonymous
Not applicable

Its simply takes a string type input parameter. But when I debug and check the input parameter in VB, its empty.

 

'Lisp

(vl-catch-all-error-p
              (setq TempObject
                     (vl-catch-all-apply
                       'vlax-invoke-method
                       (list
                        AccDBConn 
                        "TestCall"
                        "input String"
                        )
                     )
              )
            )

'VBA

AccDBConn .TestCall ("input String")

 

 

 

0 Likes
Message 4 of 5

Ranjit_Singh
Advisor
Advisor

@Anonymous wrote:

Its simply takes a string type input parameter. But when I debug and check the input parameter in VB, its empty.

 

'Lisp

(vl-catch-all-error-p
              (setq TempObject
                     (vl-catch-all-apply
                       'vlax-invoke-method
                       (list
                        AccDBConn 
                        "TestCall"
                        "input String"
                        )
                     )
              )
            )

'VBA

AccDBConn .TestCall ("input String")

 

 

 


As far as I can tell TestCall is  a function and should not be passed as a string. What happens when you replace

(list
                        AccDBConn 
                        "TestCall"
                        "input String"
                        )

with

 

(list
                        AccDBConn 
                        'TestCall
                        "input String"
                        )

I would also get rid of the entire apply block and simply call the method and see if it works. Once you have a working solution then move on to the apply block.

 

(vlax-invoke-method AccDBConnObject 'TestCall "input String")
0 Likes
Message 5 of 5

Anonymous
Not applicable

I have already tried evreything that you have suggested. However you call, the function gets called but input parameter value doesn't get to the function.

I am not sure why you say "TestCall is  a function and should not be passed as a string"? Function can take any string input parameter.

I have even tried function with integer parameter , setting a property , no matter what you do, the function gets called by input value is never set.

 

To me it seems its probably something to do with 64 bit and 32 bit. My COM component is 32 bit.??

0 Likes