1. ilya Milin
  2. PowerBuilder
  3. Monday, 12 July 2021 15:55 PM UTC

PB 2017-R3/Windows 10(32)

After migration to Win 10(32) the following code related to graphics stopped working. FileExists confirms the existence of the file but ReadFromFile failed(just hanging) do not see the way to debug farther 

if not FileExists(g_file.work_dir + asReportID + ".vtc") then  // verified manually: really exists
  Return lsWarning
end if

uo_parms.ole_main.Object.ReadFromFile(g_file.work_dir + asReportID + ".vtc")

Is there anyone familiar with .vtc files and the reason why the script stop reading them after the migration to Win10.

Thanks in advance,

Ilya Milin

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 12 July 2021 17:28 PM UTC
  2. PowerBuilder
  3. # 1

Hi Ilya;

  I wonder if this might work? My thought here is that the OLE object wants a cleanly initialized string as the argument, as follows:

  • String   ls_file
  • ls_file  = g_file.work_dir + asReportID + ".vtc"
  • if not FileExists ( ls_file  ) then  // verified manually: really exists
      Return lsWarning
    end if
  • uo_parms.ole_main.Object.ReadFromFile ( ls_file  )

Regards ... Chris

Comment
There are no comments made yet.
ilya Milin Accepted Answer Pending Moderation
  1. Monday, 12 July 2021 17:55 PM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

Thanks for your reply. I have implemented this, but unfortunately - doesn't work. Any other ideas?

 

Comment
  1. Chris Pollach @Appeon
  2. Monday, 12 July 2021 19:29 PM UTC
My next suggestions are:

1) Check the OLE ReadFromFile's return code

2) Wrap the "ReadFromFile" call in a TRY..CATCH. The "Exception object can often supply you with further error code & error message information as to what might be going wrong.

HTH
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Monday, 12 July 2021 17:58 PM UTC
  2. PowerBuilder
  3. # 3

Ilya - What version of Windows did you migrate from?

Does this fail when running the PB application from the PB IDE, from the compiled application, or both? Have you tried running as Administrator as a test?

Are you able to successfully open the file using its native application (is this a BrainVoyager QX Time Course Data file), with the same Windows user and PC?

Does this file exist in a "psuedo-folder", such as "My Documents"? If so, can you test with a copy of this file placed in a "normal" folder, such as C:\Temp?

It seems every new release of Windows alters (read: makes it more difficult) to perform file operations due to changes in security.

Best regards,
John

Comment
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.