IE 6 and runtime error 6025

Discussion in 'NZ Computing' started by Nik Coughin, Mar 3, 2005.

  1. Nik Coughin

    Nik Coughin Guest

    Re: My recent post "Site check please, dumb ass bug":

    > The HTML and CSS both validate, but when I try to access the site from any
    > of the computers on their network IE
    > 6 crashes with this:
    >
    > Microsoft Visual C++ Runtime Library
    > Runtime Error!
    > Program C:\Program Files\Internet Explorer\IEXPLORE.EXE
    >
    > R 6025
    > - pure virtual function call


    Someone pointed this out in another newsgroup; one of the css files that I
    was @importing was blank. It was a php file containing nothing but this:
    <?php header('Content-Type:text/css'); ?>

    I changed it to:
    <?php header('Content-Type:text/css'); ?>
    /* do nothing */

    ....and now it doesn't crash IE with a runtime error anymore.

    The reason I had a blank stylesheet is that every page on the site is
    associated with a stylesheet in case I want to make page specific tweaks...
    it's more trouble to specifically exclude loading a stylesheet on just one
    page than to occasionally feed a page a blank stylesheet.

    Also, a big up to Brett Roberts of Microsoft, who was very helpful.

    --
    "Come to think of it, there are already a million monkeys on a million
    typewriters, and the Usenet is NOTHING like Shakespeare!" - Blair Houghton
    -=-=-=-=-=-=-=-=-=-=-=-
    http://www.nrkn.com/
    -=-=-=-=-=-=-=-=-=-=-=-
     
    Nik Coughin, Mar 3, 2005
    #1
    1. Advertising

  2. Nik Coughin

    AD. Guest

    On Thu, 03 Mar 2005 18:29:34 +1300, Nik Coughin wrote:

    > Someone pointed this out in another newsgroup; one of the css files that I
    > was @importing was blank. It was a php file containing nothing but this:
    > <?php header('Content-Type:text/css'); ?>
    >
    > I changed it to:
    > <?php header('Content-Type:text/css'); ?> /* do nothing */
    >
    > ...and now it doesn't crash IE with a runtime error anymore.
    >
    > The reason I had a blank stylesheet is that every page on the site is
    > associated with a stylesheet in case I want to make page specific
    > tweaks... it's more trouble to specifically exclude loading a stylesheet
    > on just one page than to occasionally feed a page a blank stylesheet.
    >
    > Also, a big up to Brett Roberts of Microsoft, who was very helpful.


    I'll have to keep that in mind. I had been toying with ideas of
    dynamically generating css via php (or similar) for a while. I just hadn't
    come up with an urgent need yet ;)

    One drawback that I had thought about is losing the advantage of caching
    the stylesheets, but there should be various way of mitigating that.

    --
    Cheers
    Anton
     
    AD., Mar 3, 2005
    #2
    1. Advertising

  3. Nik Coughin

    Nik Coughin Guest

    AD. wrote:
    > On Thu, 03 Mar 2005 18:29:34 +1300, Nik Coughin wrote:
    >
    >> Someone pointed this out in another newsgroup; one of the css files
    >> that I was @importing was blank. It was a php file containing
    >> nothing but this: <?php header('Content-Type:text/css'); ?>
    >>

    >
    > I'll have to keep that in mind. I had been toying with ideas of
    > dynamically generating css via php (or similar) for a while. I just
    > hadn't come up with an urgent need yet ;)
    >
    > One drawback that I had thought about is losing the advantage of
    > caching the stylesheets, but there should be various way of
    > mitigating that.


    Hi Anton, you can put this at the top of your CSS document:

    <?php
    $ifModifiedSince = preg_replace( '/;.*$/', '', $HTTP_IF_MODIFIED_SINCE );
    $mTime = filemtime( $SCRIPT_FILENAME );
    $gmDateMod = gmdate( 'D, d M Y H:i:s', $mTime ) . ' GMT';
    if( $ifModifiedSince == $gmDateMod )
    {
    header( 'HTTP/1.1 304 Not Modified' );
    exit;
    }

    ob_start( 'ob_gzhandler' ); //use compression to make the transfer smaller
    header( 'Last-Modified:'.$gmDateMod );
    header( 'Cache-Control: public' );
    header( 'Content-Type: text/css' );
    ?>
     
    Nik Coughin, Mar 3, 2005
    #3
  4. Nik Coughin

    AD. Guest

    On Fri, 04 Mar 2005 11:14:14 +1300, Nik Coughin wrote:

    > Hi Anton, you can put this at the top of your CSS document:
    >
    > <?php
    > $ifModifiedSince = preg_replace( '/;.*$/', '', $HTTP_IF_MODIFIED_SINCE
    > ); $mTime = filemtime( $SCRIPT_FILENAME ); $gmDateMod = gmdate( 'D, d M
    > Y H:i:s', $mTime ) . ' GMT'; if( $ifModifiedSince == $gmDateMod )
    > {
    > header( 'HTTP/1.1 304 Not Modified' ); exit;
    > }
    > }
    > ob_start( 'ob_gzhandler' ); //use compression to make the transfer
    > smaller header( 'Last-Modified:'.$gmDateMod ); header( 'Cache-Control:
    > public' );
    > header( 'Content-Type: text/css' );
    > ?>


    Cheers for that Nik.

    That does seem like a good solution for relatively static CSS, but I was
    more thinking about the kind of stuff you could do with a very dynamic
    stylesheet.

    eg allowing each user to have their own customisable CSS settings
    (including accessibility stuff or even layout eg for portals), or CSS that
    adapts to which part of the site you are on or any other conceivable
    factor. As an artificially lame example: colours could heat up as the
    server gets busier etc.

    Then again adapting that code snippet to pull the modified times from a
    settings database instead of the filesystem shouldn't be too hard. That
    would work for per user stuff at least.

    I'd probably want to split user and location specific CSS into two parts
    and import them. The user specific stuff could be based on settings
    databases, while the location specific stuff could just be pregenerated
    @import files a bit like how you're doing at the moment, and your file
    modification time example above would work nicely. The pregenerated files
    could even be produced by Perl, Python, XSLT etc.

    As I said I don't have any real world uses for this stuff yet, at the
    moment I'm just lazily toying with ideas.

    --
    Cheers
    Anton
     
    AD., Mar 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?a3Jha3JqYWs=?=

    Runtime Error!

    =?Utf-8?B?a3Jha3JqYWs=?=, Apr 1, 2005, in forum: Wireless Networking
    Replies:
    3
    Views:
    920
    =?Utf-8?B?a3Jha3JqYWs=?=
    Apr 5, 2005
  2. why?
    Replies:
    2
    Views:
    3,860
    dfederic
    Apr 28, 2006
  3. Beans

    Error Code R 6025

    Beans, Jul 16, 2004, in forum: Computer Support
    Replies:
    1
    Views:
    1,245
  4. dotcom

    Lost Taskbar + Error 1068 + Runtime error 462

    dotcom, Jul 18, 2005, in forum: Computer Support
    Replies:
    1
    Views:
    2,849
    pcbutts1
    Jul 18, 2005
  5. ldevenitch

    IE8 and asp Runtime error

    ldevenitch, Jul 22, 2010, in forum: General Computer Support
    Replies:
    0
    Views:
    1,059
    ldevenitch
    Jul 22, 2010
Loading...

Share This Page