SDK environment sample question

Hello,

SDK environment sample does not appear to run in its $(Output) directory without the need of copying all the DLLs from the bin folder.

in this case, the resources are not shown in the login dialog, am I missing something?

Also in this case  aaApi_Initialize(AAMODULE_TOOLS); returns false; // in CEnvironmentDlg::OnInitDialog()

aApi_GetLastErrorId() returns error code "140"

aaApi_GetMessageByErrorId(140) returns nothing.

My application is also returning 140 with flag AAMODULE_IDESKTOP, is this the missing resources?

Thank you

~Dan

Parents
  • Daniel,

    You need to change the value for your working directory to be the ProjectWise "bin" directory -OR- copy your .exe file to that directory and run it from there.

    As for why aaApi_Initialize() fails, I suspect that one or more of the PW DLLs are not loading because Windows doesn't know where they are.

    This sample "works" on my box if I make the following change:

    I have a bunch of Windows Environment variables, like "PWBinx86Dir", that I use to "point" to specific locations that you probably don't have on your box.  It is OK to simply browse to the correct location.

    Here's the result after making the change:

  • Hi Dan Slight smile

    This won't work for me, I need to be able to run another directory. I copied all the DLLs from the bin folder to the .EXE folder. hopefully there is a way to do this, our application is huge, and we can't install it into Bentley directories 

  • Have you tried putting the ProjectWise bin folder path in your Windows PATH environment variable so that Windows can find the DLLs?

    Here's what I did.  I added the bin path to my system PATH:

    Putting it in the OS User's PATH would work as well.  Then I started my Visual Studio session and put the working directory back to what it was:

     

    Then I rebuilt the project and ran the debugger against the rebuilt application, and it ran on my box from the development folder:

    See if this approach works for your needs.

    Answer Verified By: Daniel Marcotte 

Reply
  • Have you tried putting the ProjectWise bin folder path in your Windows PATH environment variable so that Windows can find the DLLs?

    Here's what I did.  I added the bin path to my system PATH:

    Putting it in the OS User's PATH would work as well.  Then I started my Visual Studio session and put the working directory back to what it was:

     

    Then I rebuilt the project and ran the debugger against the rebuilt application, and it ran on my box from the development folder:

    See if this approach works for your needs.

    Answer Verified By: Daniel Marcotte 

Children