Crash when checking if a document has been modified locally

I experience a crash with the following code :

long projID = 271, docId = 1; //crash for any valid document values

BOOL isNewer = FALSE;
aaApi_DocumentFileLocallyModified( projID , docId , &isNewer);

Do you have the same behavior ? In the documentation, the first long parameter is labelled as the "folderID" which I assumed was a project id but could it be that a folderid is something to be different ?
  • Post your code (or snippet for more details), and what version of ProjectWise and Visual Studio that you are using, and any other helpful details and perhaps someone can spot the issue.

    Here's what I tested, and "it works on my box".

    // testing
    extern "C" int WINAPI DocCmd_ModifiedLocally
    (
    unsigned int	count,
    long*			pProjects,
    long*			pDocuments
    )
    {
    	AFX_MANAGE_STATE(AfxGetStaticModuleState());
    
    	BOOL isNewer = FALSE;
    	BOOL returnCode = FALSE;
    	LONG projID = *pProjects;
    	LONG docId = *pDocuments;
    
    	returnCode = aaApi_DocumentFileLocallyModified(projID, docId, &isNewer);
    
    	if(isNewer)
    		aaApi_MessageBox(L"TRUE", MB_OK);
    	else
    		aaApi_MessageBox(L"FALSE", MB_OK);
    
    	return 0;
    }
    

    I used ProjectWise SDK version 10.00.03.140, ProjectWise Explorer version 10.00.03.167, and Visual Studio 2015.

    Answer Verified By: Guillaume Charbonnier 

  • Thank you very much Dan ! I found out that the crash I did experienced had actually nothing to do with aaApi_DocumentFileLocallyModified...(I was willing to retrievie a project property with  aaApi_GetProjectStringProperty whilst I used by error GetDocumentStringProperty...)