Hello,
We're utilizing "https://docs.appeon.com/pb2021/application_techniques/Calling_C_Assembly_in_an_Application.html"; sample of the PowerScript code that calls the C# assembly after the import, without encapsulating the DotNetAssembly object. While it works on a particular machine where the powerbuilder is installed via executable located on a network drive, it crashes when that same executable of deployed application is accessed via laptop pc (via VPN). Would you please advise what can be done to correct this issue.
Thank you
regards
ls_currentDir = GetCurrentDirectory() // later we restore to the active/current (at this moment) directory.
if len(is_appdir) > 0 then
// is_appdir is where the EXE is (or pbt when running from the IDE)
ChangeDirectory ( is_appdir )
end if
The disadvantage is that when you manipulate files (read/write), the internal windows directory (current directory) no longer points to where your executable is.
Therefore you store that directory right after opening the application, so you can always use it anywhere else in the application.