Results 1 to 10 of 10

Thread: Tstream.seek not implemented...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Because you are using the TStream 'abstract' class - it's not meant to be used directly, It doesn't have .seek() etc implemented.

    Check out TMemoryStream which will give you what you're after.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  2. #2
    Quote Originally Posted by phibermon View Post
    Because you are using the TStream 'abstract' class - it's not meant to be used directly, It doesn't have .seek() etc implemented.

    Check out TMemoryStream which will give you what you're after.
    I have unDeleted your post (hope you don't mind) as you are partially correct.

    The TStream is indeed intended to be an abstract class but it does have Seek method implemented. Infact they are two versions of Seek method implementations (Delphi XE3). One to work with 32 bit offsets and another to work with 64 bit offsets.
    Now these are implemented in such way that one of tem is always called and it contains special code to check if the method was called from base class (raises an exception) or if it was overriden in one of its decendant classes.
    This specific code seems pretty wierdly implemented but I sugest you take a look at it as I belive that perhaps such approach might cme usefull when designing classes.
    Well not verry likely but still. It doesen't hurt to know

  3. #3
    Quote Originally Posted by phibermon View Post
    Because you are using the TStream 'abstract' class - it's not meant to be used directly, It doesn't have .seek() etc implemented.

    Check out TMemoryStream which will give you what you're after.
    Thanks phibermon

    I use TMemoryStream but it does't work so i try this and it works just fine...

    instead load image from file with

    Code:
     
      LoadImageFromFile(SnapImg,myImg);
    i loaded directly to TMemoryStream

    Code:
      strm1.LoadFromFile(SnapImg);
    the rest i left just the same and it works...

    Thank you...

    [/code]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •