Page 1 of 1

File open from double click

Posted: Thu Jul 24, 2008 11:18 am
by jsc
Another 2.2 problem

Just tried to open an existing 10mb gfr by double-clicking from total commander. Dplot opened, looked like it was digesting the file for about 20-30 seconds, then just closed and disappeared.

Opens file without complaint if I open it from the Dplot open menu.

Did the same thing with a small file as well.

Guess what? Works fine if I double-click one of the new grfz files! (I like that capability, compressed, that is. Thanks!)

Posted: Thu Jul 24, 2008 11:58 am
by DPlotAdmin
Jon,
I dunno. I just tried this with a 179Mb file and it worked fine, so whatever the problem is it isn't file size (though I would have been very surprised if that was the case).

10Mb is probably a bit large for either of our e-mail accounts. If you have a server where you can put the file please let me know. Or if it zips up well send me the zipped file, please.

Posted: Thu Jul 24, 2008 12:58 pm
by jsc
Doesn't matter what file size. Sometimes crashes the same way with a 5k grf file, but seems to be 100k files and larger cause the crash.

Doesn't matter if I try to launch from Total Commander or from Windows Explorer. DPlot opens, then sits blank for 20-30 seconds, then closes.

I'm seeing DPlot open after a double click, but nothing happens, ie, blank graph window, Dplot stays open, but no processor cycles at all. For small 5k file, DPlot stays open, menus act like everything is okay. Big files - no cpu activity, then the crash after 20-30 seconds.

Launching DPlot, then opening file from File Open menu is no problem.

Double-clicking a compressed grfz file opens without problem.

Posted: Thu Jul 24, 2008 2:19 pm
by jsc
Note - on my system winxppro sp2, current, todays grf icon was a correct document icon.

grfz icon was using an app_icon for a document.

Don't know if this means anything, but read on.

I changed the name of a grf file to grff and double-clicked it. Told Windows to always use Dplot.

File opened without any trouble.

Went to registry. Found grff extension in HKCR. Key had REG_SZ = grff_auto_file.

Looked at grf key. REG_SZ = DPLOT

Looked at grfz key. REG_SZ = grfz_auto_file

I then blew away all grf, grff, and grfz extensions and another reference to those extension in the registry (I know just enough to be dangerous, but I've been lucky so far...)

I rebooted.

I found a grf file, double-clicked, and Windows asked me what program to use. I said always use Dplot for Windows.

File opened - no problem.

I closed and then double-clicked again. Again, no problem.

I looked at HKCR key. Now key for grf = grf_auto_file, not DPlot as before.

I restarted Total Commander, but now icon for grf document was using an App_icon instead of a doc_icon. Same as grfz, after I told Windows about grfz files again.

So, I'm somewhat fixed, but don't know exactly what is going on. Wonder if something was still wrong from the last time I had the icon problem on this machine. But it was seemingly fixed in one of the recent updates. Current DPlot default icon is "C:\PROGRAM FILES\DPLOT\DPLOT.EXE,1" (without quotes).

So only problem now seems to be that the wrong icon is being used for the document.

Posted: Thu Jul 24, 2008 2:41 pm
by DPlotAdmin
Thanks for all the info, Jon. I'm not sure what's going on there but will dig into it.

Posted: Thu Jul 24, 2008 6:30 pm
by DPlotAdmin
Jon,
I'm not getting a crash but, after clearing the registry of any vestiges of the .grf extension, rebooting and installing DPlot, I now get unexpected results when double-clicking .grf files. DPlot.exe launches but never opens the file. (It never crashes, either, but this was certainly unexpected.)

Right now I can't explain why this will work for you, but I believe it will:
1) With regedit get rid of all grf_auto_file entries.
2) Reboot (perhaps not necessary, I'm just paranoid).
3) Re-install DPlot and check the "associate .grf files with DPlot" boxes.
4) Run regedit again and navigate to HKEY_CLASSES_ROOT\DPLOT\shell\open\command. This most likely shows the path to dplot.exe, as in:

"C:\Program Files\DPlot\dplot.exe"

Change that to

"C:\Program Files\DPlot\dplot.exe" "%1"

and close regedit. No need to reboot; now double-clicking .grf files will work as expected... he says, crossing his fingers. It did for me, anyway. If you dig around in the registry... well, actually this will no longer work since you got rid of grf_auto_file, but it used the "%1" parameter.

The strange thing is this isn't something I've messed with in the install script in years. I'm pretty sure the "%1" parameter was never in there and also that it hasn't been needed. What should happen is the program specified by shell\open\command gets launched, and then the ddeexec command [FileOpen(%1)] kicks in. But that's obviously not what happens.

I still have no explanation for why, regardless of how fouled up the registry was, you could earlier crash DPlot by double-clicking a file, but I'll think on that one some more.

Thanks for your time, as always.

Posted: Thu Jul 24, 2008 7:06 pm
by DPlotAdmin
Aaarrrggghhh.

Hoping you haven't read the above yet. If you get here before there, please don't bother with all that. Sometimes I'm fairly thickheaded - the previous solution will work once, but since DPlot rewrites those registry entries every time it runs it will only work once.

I'm dead-solid-certain I haven't changed the code that writes those registry values, so there must be something else going on. Most likely it has something to do with figuring out (or not!) the file type because of the addition of the compressed file format.

I'll post a fix as soon as I find it. Thanks again for your time; sorry for the trouble.

Posted: Thu Jul 24, 2008 8:52 pm
by jsc
Just now sat down on my home machine to "decompress" (me, not some file!). First thing I did was launch DPlot (2.1.8.1) and told it to check for updates. Web update went out, found the update (2201), seemed to run normally, BUT DPLOT DIDN'T RELAUNCH AT THE END OF THE PROCESS LIKE IT NORMALLY DOES!

So I used my favorite program, Total Commander (DPLOT is very close second!!), and tried to double-click an existing file. Dplot opened, then sat there, and nothing happened.

Smaller files < 100k or so - Dplot just sits there, nothing else happens.

Larger files 5meg, Dplot sits for 30 seconds, then closes by itself.

No cpu cycles in task manager - Dplot just quits.

File>Open works okay.

So second system. (WinXP Home, SP3, however)

Will try clearing the registry again, and see if that sticks.

Posted: Fri Jul 25, 2008 12:56 am
by DPlotAdmin
Jon,
Thanks again for your input.

This is going to be one of those things that has me banging my head on my desk for a while, I think.

I've installed old versions and double-clicking works fine. So whatever the problem is, it isn't a Windows update that fouled things up.

I removed all code having anything to do with compressing files in case there was something really weird going on with ZLIB1.DLL. No change.

What should happen when you double-click a file is the DPLOT\shell\open\command value is run (normally 'C:\Program Files\DPlot\dplot.exe") and then the ddeexec entry kicks in and opens a file with [FileOpen("%1")]. But my DDE stuff is never being called when double-clicking, unless DPlot is already open. If I change DPLOT\shell\open\command to a grf_auto_file-like

"C:\Program Files\DPlot\dplot.exe" "%1"

it works, AND the ddeexec command is also run, so you end up with 2 plots of the same file, one with a "1" suffix.

Both of the above tell me there's some sort of timing issue involved and, for whatever reason, DPlot is taking too long to get fired up and be ready to accept DDE commands. But this seems unlikely as I have a hotrod system here that launches DPlot fairly quickly.

Worst case (but I'm a long way from accepting worst case yet), I can throw out all the DDE stuff from the registry entries and use the %1 on the command line. The only practical reason to keep the DDE stuff (other than I want to figure out what's going on here) is that as is right now, you can right-click on a GRF file and select Print, which will open DPlot, print the file, and close DPlot if it wasn't already open... which is a nice feature that I've never used other than to test, so I don't know how important "nice" is.

No reason to reply to any of this, it's really meant more for me, hoping something will occur to me if I try to explain this stuff to somebody else. Nothing yet :-)
and told it to check for updates. Web update went out, found the update (2201), seemed to run normally, BUT DPLOT DIDN'T RELAUNCH
AT THE END OF THE PROCESS LIKE IT NORMALLY DOES!
This I haven't been able to duplicate, and I tried it on both XP and Vista. Thanks for the heads up, though - will look into it.

Posted: Fri Jul 25, 2008 1:48 am
by DPlotAdmin
Found it! :-)

The problem is in this change:
Removed a bad bottleneck when working with large data sets. In previous versions if a document window was maximized and you activated another document, then switched back to viewing the original document, the plot was redrawn from scratch rather than simply displaying the saved bitmap of that plot. It was redrawn because the action of activating a maximized document causes all other documents to be "restored" and thus resized, though they are hidden. This led DPlot to delete the saved bitmaps in preparation for the next time the window was displayed.
With those changes omitted, double-clicking works again. I'm obviously neglecting some startup condition that doesn't apply at other times, will probably find it after a few more doses of medicinal Wild Turkey. But if I don't, the worst case just got better and you'll have to put up with the same needless redraws you've put up with all along. I think that's unlikely, though. With any luck I'll be posting an update tomorrow (Friday) night.

Posted: Fri Jul 25, 2008 6:41 am
by jsc
Watch out for those medicinal doses - you'll have trouble finding the keyboard! (And you should be finding your way to bed!)

Jon

Posted: Fri Jul 25, 2008 2:16 pm
by DPlotAdmin
Jon knows, but for anybody else following this topic the problem has been fixed and a new version uploaded. If you're a licensed user you can get the update with Check for Updates on the Help menu. If you're on the mailing list... mail is going out as I write this.