0

When I use this snippets:

Local $oTask = $oHttp.DownloadBdAsync("https://.............pl/..........", $oBinData)
ConsoleWrite($oHttp.LastErrorText)

I get this error:

ChilkatLog:   
ActiveXError:
DllDate: Sep 28 2020
ChilkatVersion: 9.5.0.84
UnlockPrefix: ************
Architecture: Little Endian; 32-bit
Language: ActiveX
VerboseLogging: 0
Cannot get ActiveX Interface   
--ActiveXError
--ChilkatLog

Why I get this error ?

btw.

Local $iSuccess = $oHttp.DownloadBd("https://.............pl/..........", $oBinData)
ConsoleWrite($oHttp.LastErrorText)

Works fine

Michał Lipok
  • 365
  • 6
  • 24

1 Answers1

0

I don't know if this is correct, but in other languages the "Set" keyword would be needed if an object is returned instead of a primitive value. Given that a Chilkat async method returns a Chilkat Task object (https://chilkatsoft.com/refdoc/xChilkatTaskRef.html) perhaps this is the solution:

 Local $oTask
 Set $oTask = $oHttp.DownloadBdAsync("https://.............pl/..........", $oBinData)

This is just a guess...

Chilkat Software
  • 1,405
  • 1
  • 9
  • 8
  • `Autoit` doesn't use `set`. The syntax used in the question is fine. – Stephan Dec 30 '20 at 16:24
  • 1
    Try re-registering the Chilkat ActiveX DLL. It may be that somehow registration entries in the Windows registry were deleted by something unrelated to Chilkat. – Chilkat Software Jan 04 '21 at 17:16
  • This is a good tip, as I do not have registered object, I use technique which do not require registering. So now I wonder if the main object is accesible for me in my DEVEnvironment on runtime, why all the **Async methods require separate way of accessing the same object ? – Michał Lipok Jan 06 '21 at 18:49
  • 1
    It's because Chilkat is returning a new instance of the Task object. To create the ActiveX object instance (from within the C++ implementation) requires that the ActiveX DLL be registered. – Chilkat Software Jan 07 '21 at 23:58
  • Just checked with registered dll. Works fine...... Here [link](https://www.chilkatsoft.com/refdoc/xChilkatTaskRef.html) I can see that I can use this kind of code `(VBScript) set obj = CreateObject("Chilkat_9_5_0.Task")` to create such obejct. – Michał Lipok Jan 09 '21 at 00:34
  • So I was curious how I can use them, but here `https://www.example-code.com/vbscript/` I was not able to find any example how to create this object and use them. So I assume that Task object is always created internally by the DLL ? I found also that I can create the Task object by my self with my technique (without dll registering) so I ask is there a way to create this task object by my self and flag them to DLL that this my instance will be used for next tiem when ActiveX object should to create new instance ? – Michał Lipok Jan 09 '21 at 00:58