LoadPictureFile failing if pictures are in readonly folders

Started by leo9, August 14, 2018, 10:31:13 AM

Previous topic - Next topic

leo9

I am returning to an old OpenDCL project and am trying to load a new JPG into an existing Picture Box using LoadPictureFile, but the picture is not being loaded.

The JPGs are stored in a subfolder of ProgramData.  If I copy that subfolder to the root of C drive, and point LoadPictureFile to that folder instead, it loads the picture OK.

So perhaps it's something to do with the folder permissions in ProgramData?

Is there any solution?

Fred Tomke

Hello, leo, have you checked the fullpath of the file in ProgramData using findfile? Maybe it's a problem of type mismatch. I also LoadPictures from Programdata path.
Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

leo9

Hi Fred, I checked the path and it was OK.  So then I rebuilt the whole installation but specifically assigned full permissions to that JPG folder in the installation software (InstallShield).  Now LoadPictureFile works for that new JPG. 

I remember a while ago that I had a similar problem with DWG Preview not showing previews of drawings stored in Program Files, so I moved the drawing folder to ProgramData and it worked.

Perhaps ProgramData folder permissions behave differently depending on the version of Windows?  I'm using Windows 10 now but the original project (when I had no problem with LoadPictureFile and ProgramData folders) was done on Windows 7.