folderitem.launch does not launch PDF

Hi all - I have a Windows client evaluating our payroll software, and we supply various PDF documents in a man subfolder, and generate a number of PDF output files (tax certificates etc)…but at this particular site it seems that f.launch (f being the PDF) doesn’t do anything - no error, just nothing.

This is the only site I’ve ever seen that doesn’t open a PDF in whatever viewer they use.

If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).

Perhaps this could be a profile security issue? Anyone encountered such weirdness (and hopefully a solution)?

Many thanks.

Silly question… but are you sure the path information in “F” is 100% correct?
put a break at the Launch and examine it… it needs to be the FULL path to the document

Works in almost 100% of cases - this is the only time I’ve ever seen or heard of it not working (out of 1000’s of sites).

[code]Function HelpThepayprocess() As Boolean
dim f as FolderItem

if Develop() then
f=GetFolderItem(“man”).Child(“PDF”).Child(“Pay Process.pdf”)
else
f=GetFolderItem(“man”).Child(“Pay Process.pdf”)
end

if f.Exists then
f.Launch
else
MsgBox(“File not found”+EndOfLine+EndOfLine+“Sorry, the file Pay Process.pdf isn’t where it should be”+EndOfLine+EndOfLine+“Please visit the website for the latest documentation (Help…Website)”)
end

Return True

End Function[/code]

and if you do a break point at LAUNCH it does in fact stop there? but then “nothing happens”
what is f.lasterrorcode?

Is it possible that they do not have a PDF viewer installed, or don’t have a default application selected for PDF files?

Thanks Dave

No idea - the site is in the Cook Islands, I’m in New Zealand. The price we sell a product for doesn’t permit writing a custom build and deploying it for a problem that exists on one machine and works flawlessly everywhere but there…I could log it in the next build but I’m pretty suspicious of the machine itself or a security or profile setting somewhere…so, it’ll take some time to get any in-depth info about f.lasterrorcode (good idea, I’ll log it)

[quote]If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).
[/quote]

I’m going to suggest they try it on a different machine - if the same thing happens then I’ll be sure that their security profile (or whatever) is affecting the app’s ability to launch a PDF (they’re on Windows 7 Service Pack 1 (Build 7601)) - and if that’s the case then I still don’t have a solution - maybe move them to our cloud edition (love XojoWE)

I would instruct them how to install PDF Reader. It’s probably the problem. Windows 7 has nothing in the default system to read PDF.

Have they run (or you remotely) the application as ADMIN? Maybe their security (as you say) prevents your app from launching the application from within. You could also try to shell to it, but you said creating a custom build is not an option.

Thanks Michel and Langue - the user is able to install the software, but we could try running it explicitly as Admin and see what happens. They’re installing a trial on a different machine to assess if it’s global at their site (then it’s security - it is a gov site…), otherwise just the original PC - and maybe reinstalling the reader will correct the problem (though as I’ve said already the association appears to work correctly - double-clicking the pdf itself opens OK in Adobe Reader - man I hate windows.

Ok - Ive added this to the code and it’ll log any errors (and display it). Weird.

    if f.LastErrorCode <> 0 then
      WriteError("Cannot open "+f.ShellPath+": error code "+str(f.LastErrorCode))
    end

Thanks - I’ll report back if I find out anything useful :slight_smile:

bit nit-picky, but I’d change that to NATIVEPATH instead of SHELLPATH… but thats just me :slight_smile:

On PC, it is exactly the same thing.

Definitely just that machine - another at the same site works just fine.

IT will reinstall reader to see if that resolves the issue…ball in their court.

Hello guys, apparently I started to get same issue on the latest XOJO and on the latest build, I have 2 PDF’s both of them are opening fine in Preview if you double click on them, but when using .Launch one is opening, the other one does not , even if the file exists and it works well on the OS side, Xojo app side simply stops working .

Any ideas on this ?

The command to use in the latest Xojo is FolderItem1.Open(True) (API2).

As RN said, FolderItem1.Launch is deprecated.

[quote=476530:@Emile Schwarz]The command to use in the latest Xojo is FolderItem1.Open(True) (API2).

As RN said, FolderItem1.Launch is deprecated.[/quote]
Well deprecated but it still works on other files so I guess I’ll have to try 2.0 thanks for that.

Well apparently with .Open I get the following error while wrapping it with Try / Catch

Anybody know what OSStatus -36 is ?

Thanks

Run Disk Utilities.

Where is stored that file, in an embeded hard disk, an external hard disk, a local NAS, some kind of cloud, something else not disclosed ?

-36, in the old time, was I/O error, now ?

[quote=476535:@Aurelian Negrea]
Anybody know what OSStatus -36 is ?[/quote]
From CarbonCore/MacErrors.h

Not really helpful I guess…

Yes, not really helpfull. What do you do in that case ?