#1 Re: Other components » Open Source SynTaskDialog unit for XP,Vista,Seven » 2012-11-03 16:21:51

Hi Bouchez and other Synopse developers.

As the documentation of TTaskDialog.Execute() method said,

"It returns 0 on error, or the Button ID, or 100 for the first custom button defined in Buttons string."

My problem is that when TTaskDialog.Execute() returns 0, it seems there is no way to know what is the OS error code for the error because the the error code returned by TaskDialogIndirect() has been eaten by this code:

if TaskDialogIndirect(@Config,@result,@RadioRes,@VerifyChecked)<>S_OK then
      result := 0;

Since the return value of TaskDialogIndirect() is already an error code of type HRESULT, I guess I cannot use GetLastError() to get extended error information. Am I right? If yes, would you change a bit the implementation of TTaskDialog.Execute() somehow to make getting the last OS error code becomes possible? For example:

hResult_ := TaskDialogIndirect(@Config,@result,@RadioRes,@VerifyChecked);
if hResult_<>S_OK then begin
  result := 0;
  SetLastError(hResult);
end;

Thanks in advance.

Board footer

Powered by FluxBB