- Stephan Daschek
- PowerBuilder
- Friday, 10 January 2025 07:06 AM UTC
Hi,
it seems like PowerBuilder 2022 R2 2828 ignores the path of LoadWithDotNetFramework("PATH")
the following example:
ll_rc = lnv_Assembly.LoadWithDotNetFramework ("C:\example\program1\test.dll")
if ll_rc < 0 then
e.SetMessage(lnv_Assembly.errortext)
throw e
end if
ll_rc = lnv_Assembly.CreateInstance ("Test.TestText", lnv_test)
if ll_rc = 1 then
try
ls_text = lnv_test.getText(as_text)
catch(Runtimeerror re)
e.SetMessage(re.text)
throw e
end try
End if
After i compiled the program and ran it from the command line i get the following problem:
Command Line Path = "c:\example\" and calling "c:\example\program1\program1.exe" causes non Error but ls_text is Empty.
Command Line Path = "c:\example\program1\" and calling "program1.exe" causes non Error but ls_text is Filled.
Command Line Path = "c:\example\" and exists "c:\example\test.dll" calling "c:\example\program1\program1.exe" causes non Error but ls_text is Filled.
Conclusion
LoadAssembly is looking for the dll, but it seems the dll must be located in the CurrentDirectory.
do you have an ideas.. thanks
Stephan
edit:
bad solution, but works:
ls_old = GetCurrentDirectory()
ChangeDirectory("c:\example\program1")
// complete code
ChangeDirectory(ls_old)
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.