Results 1 to 4 of 4

Thread: Current object

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    How can I get a pointer to the class of the current function? I mean like this:
    Code:
    'In class cTest
    Function SetNumber( iLast as cTest ) as Long
       Number = iLast.Number + 1
    
       Call SetNumber( Me )
    End Function
    I know ways to make the function above, I only need to know how to get the pointer.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Do you mean a pointer to the object in which case it's just objptr(me) If you need a pointer to the function you need to look it up on it's vTable but that's really hard look at http://www.bstorage.com/nervenet/vtablemodification.asp and it'll give you some clues but you'll have to work out what's going on yourself, I've never needed it so havn't looked at it very hard, I'm not sure it'll work properly either.

  3. #3
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    Me is a reference to the current class, so Call MyFunc(Me) should work.
    Hope this helps

    Crazy D

  4. #4

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Thumbs up

    thx Crazy D, works fine

Posting Permissions

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



Click Here to Expand Forum to Full Width