aaApi_DocumentSelectDlg get filter on uiCommandId

aaApi_DocumentSelectDlg get filter on uiCommandId

Hi, Calling aaApi_DocumentSelectDlg

m_param.obButton.lpctstrButtonText = _T("Open from disk");

m_param.obButton.uiCommandId = IDABORT;

 

I also have m_param.lpctstrFilter set for multiple filetypes. Is it possible to get the selected file type before m_param.obButton.uiCommandId is pressed? Is there a hook for this?

Thanks :)

  • According the SDK documentation, pre, post and action hooks are available for aaApi_DocumentSelectDlg via AAHOOK_OPEN_DOCUMENTS_DLG2. However, I don't think that helps you, as the returned output values of the passed AAOPENDOCSDLG2_PARAM structure aren't populated dynamically prior to acting on the dialog (by pressing the obButton). You could run a post hook that runs data validation on the return values, and if that fails your validation, deliver a message indicating the problem and offer the user the option to try again or cancel. That's usually how I approach these types of issues.

  • Thanks, PARAM isn't populated before or after m_param.obButton is pressed. I was hopping there was a hook for the drop down control where the user chooses the file extension, PARAM seems to be populated only on IDOK.

    IMHO param.lFilterIndex should be set when the user selects the extension regardless of whether or not  IDOK is pressed