Handle delphi events in C#.net window application

Nov 1 2011 12:32 AM
Hi,
We have a Delphi dll and we are using that dll in our c# application. We can able to import the methods and can able to use that, but struck with the event handlings. Please check the below delphi code which we need to define and handle in c#.net:
The CALLBACK API prototipes:
TSpeechEvent = procedure; procedure without parametrs
TPositionEvent = procedure(Position: dword); one dword parametr
TEngineEvent = procedure(Number: integer; Name: string); two parametrs, with Delphi string
TErrorEvent = procedure(Text: string); one parametr with string (it is Delphi string)
The regist API:
procedure RegistOnStart(CallbackAddr: TSpeechEvent);
When engine start speaking.
procedure RegistOnStop(CallbackAddr: TSpeechEvent);
When engine Stop, that means the engine fully speak all injected text and ready to read next part of text. This is one way to speak big text (read books how example). Because if you send big part of text to engine they is slowdown system and thinking lot of more time, that is not good.
procedure RegistOnPosition(CallbackAddr: TPositionEvent);
Get the current speak position in text (chars from begin of last injected Speaking text)
Thanks in Advanced.


Answers (1)