Bug with "View In Web Browser"

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
chris

Bug with "View In Web Browser"

Post by chris »

Using Textpad 4.3.2 and IE 5.01

Every so often the "View in Web Browser" quits working and gives the error: "A device attached to the system is not functioning" and does not even open up my browser. However, all associations to html pages etc work fine, and I can use other progams the launch a browser/webpage.

Anyway, keep up the good work. I especially like the "View In Web Browser" ability to actually go view the current file through the webserver, instead of just over the filesystem.
Keith MacDonald

RE: Bug with "View In Web Browser"

Post by Keith MacDonald »

Chris,

Thanks for your feedback on this command.

We most often see the "A device attached to the system is not functioning" error when an active virus checker is running, or another application is blocking DDE messages. Next time it happens, try turning off your virus checker and closing other applications, until it starts working again.

Regards,

Keith MacDonald
Helios Software Solutions
chris

RE: Bug with "View In Web Browser"

Post by chris »

I closed all of the applications (I don't run a virus checker) and this still happens.

Anyway, I think my problem was sort of a mistake on my side. The WWW root folder specified in the Configure/Preferences/Folders "WWW root folder" is a network folder, and I used a standard qualified syntax for it:

\somecomp\webserver

However, when I opened up a document to edit, I opened it through a mapped drive to the same location:

M:\webserver\index.php

And apparently Textpad doesn't resolve the actual network location of the file and so didn't like the file trying to be viewed, being that it was located in another place then the webserver. However, this seems to only happen on files without the ".html" extension. So if I were to open up a index.html file, it would load it in the web browser fine (tho not thru the webserver, just as a file on the harddrive). But loading a .php file through the webserver works fine as long as the paths match.

So, basically (i'm never good at being concise :) Textpad doesn't resolve actual network path names on mapped drives, and there is a problem viewing non ".html" extensions with the "View with web browser" option. (tho that could be a problem with my not associating ".php" extensions with IE and your use of DDE messages for launching the file.)

Also, may I suggest that you do not gray out the "View in web browser" option when viewing non standard extensions? For example I view .txt files in my webbrowser at times, along with other file formats and I'd fined it useful to directly launch them from textpad. I have just added "iexplore.exe" as a tool, and so can view it easily with that, but it'd be nice to view it thru the web using the "view in web browser", and not as a local file when that file is located in the webserver folder.

thanks for the previous response. Hopefully this helps some.
Alan Bellows

RE: Bug with "View In Web Browser"

Post by Alan Bellows »

Hey chris--

You can turn on "View in Web Browser" for all file types by going to Configure > Preferences, then highlight Default under Document Classes, and check the "View in Web Browser" in the right-hand pane. Of course, if you have that option unchecked for any other specific document classes, it will override the default setting for that class, so you may want to check each one.

Alan Bellows
Perl/Java Programmer, Ovid Technologies
chris

RE: Bug with "View In Web Browser"

Post by chris »

Found the option, thanks! Still a slight problem tho that deals with what I have been having trouble with:

So, I guess the whole bug/problem boils down to just this. "View in Web Browser" does not work when viewing a _local_ file that has an extension that is not associated with the default web browser.

I appriciate your responses.
Alan Bellows

RE: Bug with "View In Web Browser"

Post by Alan Bellows »

Ah, I see that you are right. I suppose that it must be a result of using DDE messages, so there is little one can do about it himself. I use a different method for my purposes... I run Apache for Win32 on my PC, and I wrote a short Perl script and set it up in my Tools menu... it sends the current file as a URL to "localhost," so it opens it through the webserver.

The advantage is that I can send JSPs, CGIs, and that sort of thing to this tool, and they will actually execute as they would on a real webserver... pretty handy. It also handles files with other extensions correctly.

Good luck,

Alan Bellows
Java/Perl developer
http://www.enol.com/~bellows
Andreas

RE: Bug with "View In Web Browser"

Post by Andreas »

Hello Alan,
this sounds like a nice idea!
Is it possible to get this perl script (posted here or to my email: a.waechter@logics.de)?
Or do I have to re-invent the wheel?
TIA,
Andreas

PS: I just noticed the ovid.com in your mail address. Funny, a few years ago I worked for a German company called ovide (which then changed its name to LARS and a few weeks ago to knowledgeparg-ag)
chris

RE: Bug with "View In Web Browser"

Post by chris »

That does sound like a useful script Alan. Like Andreas said, you should post it for general knowledge :)

I'm running Win32 Apache as well btw.

Thanks again for everyones responses on all of this. Just a quick follow up, (if Keith or another Textpad preson is reading this) could you look into having Textpad resolve a file path to the true network path, even when it is opened through a a mapped network drive? Thanks.
Keith MacDonald

RE: Bug with "View In Web Browser"

Post by Keith MacDonald »

As far as we know, there is no published API for mapping between a drive letter and a UNC path. It may be possible to do it yourself, by rummaging through the registry, but the rules may be different for each version of Windows. In addition, it's likely that you would need administrative priviliges to see that part of the registry, on NT and Win2K, so would not be a very satisfactory solution.

If anyone knows better, please share the secret.

Keith MacDonald
Helios Software Solutions
Gerry Blue

RE: Bug with "View In Web Browser"

Post by Gerry Blue »

I found this thread today while searching the forum for ways to resolve this little challenge. After reading the above messages, I came up with an alternative (albeit kludgy) solution. I created an HTML file in my workspace and called it something catchy like Redirector.html. It's a very sparce little file that has a meta http-refresh tag to the appropriate local url:


<head>
<meta http-equiv=Refresh content="0;url=http://localhost/Whatever/">
</head>
<body>
</body>


What can I say? I'm not above an occasional kludge ;)
Post Reply