GPSFileDepot Forums

General Category => Map Making Support => Topic started by: glendeni on August 03, 2012, 03:25:14 PM

Title: Abnormal termination of cpreview.
Post by: glendeni on August 03, 2012, 03:25:14 PM
I'd previously reported getting "cpreview.exe has stopped executing" messages on my Windows 7 PC, with abnormal cpreview termination so, most notably, a _MDR.IMG file was not being created.  I finally tracked down the cause so am reporting it here in case anyone else encounters the same problem, which was certainly mysterious to me.

I'd been running MapSetToolKit to create MapSource installation files from 13 .IMG files in 3 different subdirectories.  After that process, IMG files with the same names appeared in the MapSource installation directory.  I assumed that they were simply copies of the original files (the file sizes were the same, to the precision reported by Windows Explorer) used in the MS installation process.  I now realize the abnormal terminations must have been on those runs when I had, for whatever reason, closed MapSetToolKit and since it does not remember the last parameters input to it, "for convenience" I was simply selected those files since they were all in a single directory.  But there must actually be some difference between those files and the original IMG files of the same name, because testing now shows that cpreview abnormal termination always occurs if I use those files but not if I use the original files.

FWIW I tried to look into this in more detail by using a script to run cpreview.exe and pipe stdout and stderr into files - but that gave no insight since cpreview indeed stops executing, as Windows 7 reports, so no stdout or stderr is generated. But at least I now know the reason for the problem.  For me it had been confusing since it was seemingly occurring with files which I had previously run without a problem.
Title: Re: Abnormal termination of cpreview.
Post by: glendeni on August 03, 2012, 05:01:26 PM
FYI I just did  bit-by-bit comparison of files and the IMG files appearing in the MapSetToolKit install directory are identical to the original ones.  So the problem is instead due to the fact that the IMG file causing the abnormal termination is in the MapSetToolKit install directory - perhaps MapSetToolKit is trying to both read and write to the same file.
Title: Re: Abnormal termination of cpreview.
Post by: popej on August 04, 2012, 01:26:02 AM
MapSetToolKit doesn't write into img. It creates input file for cpreview (pv.txt), executes cpreview, executes cgpsmapper to compile preview map and then copies img files to mapset directory.

To create index (*_MDR.IMG) cpreview needs *.img files and *.img.idx files. Both types are created by cgpsmapper when compiling mp source. But only img are copied by MapSetToolKit to mapset directory. If you start creating mapset without *.idx files, you won't get *_MDR.IMG index.