1. Laurent LE DORTZ
  2. PowerBuilder
  3. Wednesday, 4 May 2022 07:45 AM UTC

Hi,

When one of our clients tries to open a docx file from our app, it crashes. Same with doc or docm. Other clients don't have the problem. 

No problem with xlsx files.

To open files, we use a windows API "ShellExecuteA".

Laurent

John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 4 May 2022 15:16 PM UTC
  2. PowerBuilder
  3. # 1

The user experiencing this issue does have MS Word installed, correct?

Can the user open/use Regedit? If so, check:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\OpenWithList
  and
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docx

to see if the subkeys/values look "normal" (check against your own settings or a PC that is working properly).

 

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Wednesday, 4 May 2022 14:06 PM UTC
  2. PowerBuilder
  3. # 2

Can you open the files from a File Manager window? From a CMD line? From another app?

This sounds more like an OS related problem since it's occurring on multiple file types. It might also be related to a DLL Being loaded by PB and a DLL by the same name, but different version, being used by the DOCX handler.

What's the specific  error you're seeing?

Does the same happen if you use a totally different type of file? (maybe .txt to be opened with notepad)

Comment
  1. Laurent LE DORTZ
  2. Wednesday, 4 May 2022 14:16 PM UTC
Thanks Brad.

We'll look into this DLL matter.

The files can be opened from a file manager window. I don't know from a CMD line.

No error seen. Immediate app crash.

All other different type of files are opened without any problem.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 4 May 2022 14:03 PM UTC
  2. PowerBuilder
  3. # 3

Hi Laurent;

  Other than the "ShellExecuteA" command should be "ShellExecuteW" as PB is Unicode that should work OK either way. However, you might want to give the O/S time to complete the App Start-u process by adding a Yield() command right after the ShellExecute call.  HTH

Regards ... Chris

Comment
  1. Laurent LE DORTZ
  2. Wednesday, 4 May 2022 14:12 PM UTC
Thanks Chris, we'll try that.
  1. Helpful
  1. Laurent LE DORTZ
  2. Friday, 13 May 2022 07:49 AM UTC
The ShellExceuteW command solved the problem.

Again, thanks a lot !
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 13 May 2022 16:04 PM UTC
Hi Laurent;

That is "awesome" news .. super glad that the API declaration change did the trick! :-)

Thanks for letting us know!

Regards ... Chris

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.