Client application window

The client application has a window called w_employee that displays employee data in a DataWindow control. When the user clicks the Retrieve button in the window, the client creates a shared object that communicates with EAServer. In addition, it creates an instance of a user object that is used to handle callbacks from the shared object.

Instance variables

The w_employee window has these instance variables defined:

uo_sharedobject iuo_sharedobject
uo_callback iuo_callback

Retrieve button

The Retrieve button creates the shared object that will communicate with EAServer. In addition, it creates an instance of the user object that will be used to handle callbacks from the shared object. To allow the callback object to notify the window of the completion of processing, the script calls a function called PassObject on the callback object, passing it a reference to the window. Finally, it makes an asynchronous call to the RetrieveData function on the shared object, passing it a reference to the callback object.

The Retrieve button has the following script:

long ll_rv

SharedObjectRegister("uo_sharedobject","myshare")
SharedObjectGet("myshare",iuo_sharedobject)

iuo_callback = CREATE uo_callback
iuo_callback.passobject (parent)

iuo_sharedobject.post retrievedata(iuo_callback)

SetDW function

The SetDW function applies the contents of the DataWindow Blob returned from the EAServer component to a DataWindow control in the window. The SetDW function takes the argument ablb_data, which is of type Blob, and returns a Long value. The function has the following script:

long ll_rv

ll_rv = dw_employee.SetFullState(ablb_data)
if ll_rv = -1 then
	MessageBox("Error", "SetFullState call failed!")
end if

return ll_rv