SDK: Supressing "create working directory" folder...

I'm pouring through the documentation and nothing is jumping out to me... basically what I'm wanting/trying to do is automatically supress the "create folder" dialog that comes up when a working folder (locally) isn't found. I would like to just make it automagically work as if I hit the Ok button.

 

 

Has anyone ever tried (or found a hook) to do this through the SDK?

 

 

Thx in advance,

 

Parents
  • Thanks Mike, I was afraid that was the case... it's PWE (with SSO) that I was wanting to supress it under.

     

    I agree with you Dean, it would be nice to be able to have that as a configuration option for Administrators...

     

     

    thx,

  • Stephan,

       I know this is a little late but yes you can supress the message if you know the working directory then you can use this other wise you can probably get the working directory from the default user of the datasource.

    but this is how i do it.

    first hook the login

     CString curuser = L"";

    CString wkrdir = L"";

    HDSOURCE cur_datasourcehandle;

    cur_datasourcehandle =  aaApi_GetActiveDatasource();

    assert(NULL!=cur_datasourcehandle);

    HAADMSBUFFER cur_buf = aaApi_SelectDataSourceDataBufferByHandle (cur_datasourcehandle);

    CString current_datasource_name = aaApi_DmsDataBufferGetStringProperty(cur_buf,3,0); //get the name of the current datasource

    aaApi_DmsDataBufferFree(cur_buf);

    if(L"YOUR FIRST DATASOURCE NAME HERE IF YOU HAVE TWO" == current_datasource_name)

    {

    wkrdir = L""YOUR WORKING DIRECTORY HERE";

    }

    else if(L"YOUR OTHER DATASOURCE NAME HERE IF YOU HAVE TWO" == current_datasource_name)

    {

    wkrdir = L"YOUR WORKING DIRECTORY HERE";

    }

    aaApi_SelectUser(aaApi_GetCurrentUserId());

    curuser = aaApi_GetUserStringProperty(2,0);

    if (L"" != wkrdir)

    {

    wkrdir = wkrdir + curuser;

    if (FALSE == aaApi_FileExist (wkrdir))

    {

    aaApi_CreateDirectory (wkrdir);

    }

    }

    Hope this Helps,

    CHAD

    Chad

  • IS There an option now that doesn't involve all that coding to skip or suppress the dialog for creating a working directory?

  • not that I am aware of. :(

    I did change my code a little.

    so in a login hook this should create the working directory if it doesn't already exist.

    aaApi_SelectUser(aaApi_GetCurrentUserId());

    curuser = aaApi_GetUserStringProperty(2,0);

    WCHAR buffer[_MAX_PATH] = L"";

    aaApi_GetUserStringSetting(AADMS_PAR_WRK_WORKING_DIRECTORY, buffer, ARRAY_LENGTH(buffer));

    wkrdir = buffer;

    if (L"" != wkrdir)

    {

    if (FALSE == aaApi_FileExist (wkrdir))

    {

    aaApi_CreateDirectory (wkrdir);

    }

    }

    no real error checking Slight smile

    hope this helps

    Chad

  • Thanks, I do more cadd manager and some PW admin and less IT work so can you tell me where you put this code? is it in PW admin in the software startup or?

Reply Children
No Data