Hi,
Has anybody Idea to check if dll file exist before Xojo will do it for you? Mean maybe in app.open something like
If my.dll not exit then
Msg (“you need my.dll”)
Quit()
End if
Before appear message box from xojo “Failed to load library my.dll”
Checking the existence of a file is easy, but I think you should do that in a helper app which checks the existence of the files prior to starting the app which needs to load them.
Guess you’re on Windows ?
Function FileExist(Path as String) As Boolean
Dim f as new FolderItem(Path,3)
if f.Exists then
Return True
else
Return False
end if
Hi Joost,
Yes it’s Windows but I think it will happens in any OS.
It’s just for dynamic library files check. I would like to handle this runtime error before xojo.
Are you finding the existence of a DLL so you can call it with a Declare? Just in case you don’t know, make sure your declares are Soft Declares. That means your app will check for the DLL at call-time, not on start up. There’s no way of checking for existence before your app checks if you declare using just “Declare”. You have to Soft Declare.
Hi All,
Sorry for so late response, I was checking all options.
With soft declare works as expected, thank you Garth.
Other way I cannot use External Methods to the class but I can live with that