com_serv.dpr 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. program com_serv;
  2. // Comtest from Anton K. mantis #35013
  3. uses
  4. windows,
  5. messages,
  6. sysutils,
  7. com_serv_TLB in 'com_serv_TLB.pas',
  8. com_impl in 'com_impl.pas' {TestApp: CoClass};
  9. {$R *.TLB}
  10. var msg:TMsg;
  11. res:integer;
  12. fTerminate:boolean;
  13. begin
  14. AllocConsole;
  15. fTerminate:=false;
  16. repeat
  17. if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then
  18. begin
  19. if Msg.Message <> WM_QUIT then
  20. begin
  21. TranslateMessage(Msg);
  22. writeln(format('msg.message=%.08x msg.wparam=%.08x msg.lparam=%.08x',[msg.message,msg.wparam,msg.lparam]));
  23. res:=DispatchMessage(Msg);
  24. writeln(format('result=%.08x',[res]));
  25. end
  26. else
  27. FTerminate := True;
  28. end;
  29. until fterminate;
  30. (*Application.Run;
  31. repeat
  32. Application.ProcessMessages;
  33. until Application.Terminated;*)
  34. end.