Cannot get Select Document Dialog to appear using aaApi_SelectDocumentDlg2

I have a function I'm calling through a menu in PWE, trying to get a Select Document dialog to appear. I've tried aaApi_SelectDocumentDlg and aaApi_SelectDocumentDlg2, neither will fire. When I check the last error, the code is 3 (equivalent to IDABORT I think) and the error text is "Cannot display dialog".

Here is the chunk of code I'm using that doesn't work. I suspect the problem is in the output vars but I have had no luck with trying other type defs, pointers, references, etc.

I'm hoping someone can point out the problem. Thanks.

LPLONG lplProjectId = NULL;
LPLONG lplDocumentId = NULL;
HWND hWndParent = aaApi_GetActiveDocumentList();
LONG lSelectedDocumentDlgResult = aaApi_SelectDocumentDlg2 (hWndParent,NULL,NULL,AADOCSELDF_PROPERTYMENU,0,lplProjectId,lplDocumentId);