Skip to main content

[archive] ActiveX Events

  • September 20, 2010
  • 8 replies
  • 0 views

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??

8 replies

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
To act on ActiveX events, you need to use the C$GETEVENTDATA or C$GETEVENTPARAM library functions.

Check out Appendix I, Library functions.

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
To act on ActiveX events, you need to use the C$GETEVENTDATA or C$GETEVENTPARAM library functions.

Check out Appendix I, Library functions.

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
please help me with syntax or sample..

I think:
01 GANT-MAIN-HANDLE HANDLE OF @IPHGANTX3.
01 GT-APPO HANDLE OF @IPHGANTX3.
01 STR-APPO PIC X(255).
....

ACCEPT GANT-MAIN-HANDLE.

CALL "C$GETEVENTPARAM" USING GANT-MAIN-HANDLE, "theGant", GT-APPO

MOVE SPACES TO APPO.

INQUIRE GT-APPO@Text() IN STR-APPO.

correct???

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
I go on...with testing ....and now I have this problem
" GNT: Screen name not allowed in this context"

source:

(ErrLine) CALL "C$GETEVENTDATA" USING gnt, de

MOVE SPACES TO APPO.

INQUIRE de@Text() IN APPO.

DISPLAY MESSAGE APPO.

How I "set" a ActivexObject in form to Handle, I did't used the DISPLAY ..., totem make for me this code and I can't have the reference object to a Variable ....

Sample in Acu guide:
DISPLAY Calendar line 4, column 6,
lines 10, size 40
EVENT PROCEDURE IS CALENDAR-EVENT-HANDLER
HANDLE IN CALENDAR-1.

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
To set an ActiveX handle, you have to declare the handle to the object type which you want to set it to.

Like:
77 gnt usage IphGantX.

Now, I don't remember this, but I am not sure you can assign handles to ActiveX objects through the library functions.

In the interoperability guide (A Guide to Interoperating with ACUCOBOL-GT), chapter 4 "Using ActiveX Controls and COM objects, 4.4 "ActiveX and COM events" these matters are discussed along with an example.

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
To set an ActiveX handle, you have to declare the handle to the object type which you want to set it to.

Like:
77 gnt usage IphGantX.

Now, I don't remember this, but I am not sure you can assign handles to ActiveX objects through the library functions.

In the interoperability guide (A Guide to Interoperating with ACUCOBOL-GT), chapter 4 "Using ActiveX Controls and COM objects, 4.4 "ActiveX and COM events" these matters are discussed along with an example.

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
I resolved....many thanks

COBOL:
01 GANT-HANDLES.
05 GANT-GANTX HANDLE OF IPHGANTX3.
05 GANT-DATAENTITY_TREE HANDLE OF IPHDATAENTITY_TREE.
....
CALL "C$GETEVENTDATA" USING EVENT-CONTROL-HANDLE ,
GANT-GANTX ,
GANT-DATAENTITY_TREE

INQUIRE GANT-DATAENTITY_TREE@Text() IN APPO.
DISPLAY MESSAGE BOX APPO .

VB:
Private Sub phGantX1_OnRightClickTree(
ByVal theGant As phGantXControl.IphGantX,
ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End sub

[Migrated content. Thread originally posted on 17 September 2010]

Hy I have this problem with variable in events

VB6 (working):

Private Sub phGantX1_OnRightClickTree(ByVal theGant As phGantXControl.IphGantX, ByVal theDataEntity As phGantXControl.IphDataEntity_Tree)

MsgBox theDataEntity.Text

End Sub

ACUCOBOL (not working):

Gnt-Ev-OnRightClickTree.
*

MOVE SPACES TO APPO.
INQUIRE theDataEntity@Text() IN APPO.

DISPLAY MESSAGE BOX APPO .

*

How to recover variable that was pass in event??
Good work :-)