Quote:
1) Application Freezing (or Crash) occurs when I use a PLAYSOUND (SND_ASYNC) function from Windows and then I call DBGridEh.StartLoading.
We can reproduce the error in this code
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
// PlaySound(PChar('C:\Windows\media\Ring01.wav'), hInstance, snd_Sync or snd_Resource);
PlaySound(PChar('C:\Windows\media\Ring01.wav'), hInstance, SND_ASYNC);
DBGridEh1.StartLoadingStatus('Ggggg');
Sleep(1000);
DBGridEh1.FinishLoadingStatus();
end;
can you send call stack?
Quote:
2) PERFORMANCE
Try to create Demo project using next steps.
- Change query to returns a not very large number of records. (1000)
- Use new code to save result to the table procedure TMemTableEh.SaveToFile(const FileName: string = '');
- Create Demo project with one Form and copy a Grid from the Form from your main project.
- put MemTableEh and DataSet and bind them.
- Use procedure TMemTableEh.LoadFromFile(const FileName: string = ''); to load data from File.
Code:
MemTableEh1.DisableControls;
EhDBGrid1.StartLoadingStatus('Aguarde... Buscando contas a Receber...');
// Query Execute
MemTableEh1.Close;
MemTableEh1.EmptyTable;
MemTableEh1.LoadFromFile(FileName); // 0 seconds
MemTableEh1.Open;
MemTableEh1.EnableControls; // ?? seconds to execute
Check the result of EnableControls
It it is too slow then send us a this Demo project.