question

Upvotes
Accepted
16 2 3 3

"OnUpdate" procedure of a Dex2Lib.RData object within a VBA class module.

Bonjour, new to TR I'm struggling with the "OnUpdate" procedure of a Dex2Lib.RData object within a VBA class module.

I used the tutorial document but get the following error message when compiling "Procedure declaration does not match description of event or procedure having the same name".

The request is returning data, however I'm trying to deal with the delay and I guess that this the role of the OnUpdate procedure.

I'm not familiar with Events procedures (excepted maybe in forms). There is no other procedure having the same name.

Here is the part of the code in question, in bold the event

(this is a class module)

Private m_dex2Mgr As Dex2Lib.Dex2Mgr
Private WithEvents m_rdata As Dex2Lib.RData
Private m_rdataMgr As Dex2Lib.RDataMgr

Private m_cookie As Long
Private m_hasReceivedResponse As Boolean
Private m_dataStatus As Dex2Lib.DEX2_DataStatus

Private Sub Class_Initialize()
m_dataStatus = DE_DS_NULL_EMPTY
m_hasReceivedResponse = False
Set m_dex2Mgr = CreateReutersObject("Dex2.Dex2Mgr")
m_cookie = m_dex2Mgr.Initialize()
Set m_rdata = m_dex2Mgr.CreateRData(m_cookie)
Set m_rdataMgr = m_dex2Mgr.CreateRDataMgr(m_cookie)
End Sub

Public Function WaitforResponse()
Do While Not m_hasReceivedResponse
DoEvents
Loop
End Function

Public Property Get data() As Variant
data = m_rdata.data
End Property

Private Sub m_rdata_OnUpdate(ByVal a_dataStatus As Dex2Lib.DEX2_DataStatus, ByVal a_error As Object)
m_hasReceivedResponse = True
End Sub

Would it be possible please to help ?

Merci for your help,

O.

eikoneikon-com-apivba
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
16 2 3 3

Forget it, i found the issue.

Instead of

Private Sub m_rdata_OnUpdate(ByVal a_dataStatus As Dex2Lib.DEX2_DataStatus, ByVal a_error As Object)

It has to be

Private Sub m_rdata_OnUpdate(ByVal a_dataStatus As Dex2Lib.DEX2_DataStatus, ByVal a_error As Variant)

OR

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for posting your solution !

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.