PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Help translate one VB statement to WD - activeX
[WD20] Help translate one VB statement to WD - activeX
Iniciado por vvido, 21,mar. 2016 14:33 - 6 respuestas
Miembro registrado
94 mensajes
Publicado el 21,marzo 2016 - 14:33
[WD20]
I would like to use some code presented in an VisualBasic example :

_ Set objRequest = objCharacter.Play("Announce")
_ Do While objRequest.Status > 0
_ _ Wscript.Sleep 100
_ Loop

I know how to make a call to a proc without the return value
(example taken from WD examples - ActiveX, MS Agent)

WINDEV:
AGENT>>characters(Agent)>>Play('Announce') //THIS WORKS


Because I need some more control I would like to use the logic from the visal basic example, which uses the result of the procedure call - I need access to objRequest.Status -

??? = AGENT>>Characters(“Agent”)>>Play('Announce')

How to get the result of the activeX call ??


IS THIS POSSIBLE IN WINDEW ?
HOW can I get the return value in the same way in WinDev?
Publicado el 21,marzo 2016 - 16:04
Hi

did you try with declaring a variant and setting the result in it?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


On 3/21/2016 8:33 AM, vvido wrote:
[WD20]
I would like to use some code presented in an VisualBasic example :

_ Set objRequest = objCharacter.Play("Announce")
_ Do While objRequest.Status > 0
_ _ Wscript.Sleep 100
_ Loop

I know how to make a call to a proc without the return value (example
taken from WD examples - ActiveX, MS Agent)

WINDEV:
AGENT>>Characters(Agent)>>Play('Announce') //THIS WORKS


Because I need some more control I would like to use the logic from the
visal basic example, which uses the result of the procedure call - I
need access to objRequest.Status -

??? = AGENT>>Characters(“Agent”)>>Play('Announce')
How to get the result of the activeX call ??


IS THIS POSSIBLE IN WINDEW ?
HOW can I get the return value in the same way in WinDev?
Miembro registrado
94 mensajes
Publicado el 22,marzo 2016 - 08:42
Thanks for the hint, but it does not work.
I get the following error when executing the line where the assignment occurs:

Error at line 1 of Click BTN_Test process.
Incompatible types during assignment.

It seems that there is no support for this kind of return values.
Publicado el 22,marzo 2016 - 13:14
Hi again

without the documentation of the original tool, it's hard to say...

Did you try with declaring the variable as a dynamic object (a pointer,
therefore)?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


On 3/22/2016 2:42 AM, vvido wrote:
Thanks for the hint, but it does not work.
I get the following error when executing the line where the assignment
occurs:

Error at line 1 of Click BTN_Test process.
Incompatible types during assignment.

It seems that there is no support for this kind of return values.
Miembro registrado
94 mensajes
Publicado el 23,marzo 2016 - 10:22
I hope I have understood the hint in your first response.
This is what I have done:

vVar is Variant
vVar = AGENT>>characters(“Agent”)>>Play("Announce") //<< the runtime error points to this line
Publicado el 23,marzo 2016 - 13:20
YEs you did,

now for my second answer, did you try with vvar is dynamic object ?

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


On 3/23/2016 4:22 AM, vvido wrote:
I hope I have understood the hint in your first response.
This is what I have done:

vVar is Variant
vVar = AGENT>>characters(“Agent”)>>Play("Announce") //<< the runtime
error points to this line
Miembro registrado
94 mensajes
Publicado el 23,marzo 2016 - 15:32
oh, dynamic automation object !

I have just tried with Dynamic Automation Object and it does not crash anymore.
It works and it seems that I am getting the correct values.

The problem with beginners is, that they often do not understand the instructions ...:)
And WD is so rich, that it takes lots of time to learn.

Thank you !