You can specify whether you want operations in a given module to function synchronously or asynchronously.
The naming conventions you use for operations (also known as services) can affect asynchronous mode. To ensure that your operation names map properly for async mode, do not use two operations in the same project whose names are distinguishable only because one has an underscore and one does not.
For example, you cannot have the following two operations in the same interface:
Naming Conventions for Operations to be Used in Asynchronous Mode
myservice
The reason for this is that having these two similarly named operations in async mode will result in having two different event methods with the same name.
When the Active Expert creates an ActiveX control, it creates events and corresponding methods. The Active Expert uses operation names as a basis for naming associated event methods, but ignores the underscores as a part of this process.
For a given interface with an operation called To view objects in asynchronous mode:
myservice
, the Active Expert creates an event method called myserviceasyncdone
. Similarly, for an operation called my_service
, the Active Expert creates an event method with the exact same name (myserviceasyncdone
).
Viewing Objects in Asynchronous Mode
Or
Click on the async toolbar button.
(The keyboard shortcut to show asynchronous mode is Alt V A.)
This shows the workstation objects in asynchronous mode as shown in Figure 3-5.
Figure 3-5 Workstation Objects in Asynchronous Mode
In the figure, the module BANKAPP is expanded to show the asynchronous operations contained in the TELLER interface. Note that the asynchronous operations are named in the form OperationName
Async
. The sample code shown returns the requested values as output parameters of the selected reply object operation.
To view objects in synchronous mode:
Or
Click on the sync toolbar button.
(The keyboard shortcut to show synchronous mode is Alt V Y.)
This shows the workstation objects in synchronous mode.