Declaration
[id(0x00000059), propget]
HRESULT EventServer([out, retval] IDispatch** Value);
...
Here is a Delphi sample code showing how to connect/disconnect the SomeObject.OnDeviceButton handler.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var FSigDevServerWrapper: TEventServer; |
...
procedure ConnectToDeviceServer( |
...
const EventServer: IUnknown); |
...
begin |
...
if not Assigned(FSigDevServerWrapper) then |
...
FSigDevServerWrapper := TEventServer.Create(nil); |
...
FSigDevServerWrapper.Disconnect; |
...
with FSigDevServerWrapper do |
...
begin |
...
AutoConnect := false; |
...
ConnectTo(EventServer as IEventServer); |
...
OnDeviceButton := SomeObject.OnDeviceButton; |
...
end; |
...
end; |
...
procedure DisconnectFromDeviceServer; |
...
begin |
...
if Assigned(FSigDevServerWrapper) then |
...
FSigDevServerWrapper.Disconnect; |
...
end; |
There is, however, a much simpler approach to use just
...