Results 1 to 3 of 3

Thread: How to compare 2 objects like pointers ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212
    How can I achieve to compare 2 adresses of objects liek in c++ where i would have somthin like this :

    CClass * dumpObject
    CClass * CurrentObject

    Like
    bool CList::IsInList()
    {
    return dumpObject != CurrentObject;
    }

    ...How can i achieve this in vb if i have :

    dumpObject as CClass
    CurrentObject as CClass

    function IsInList() as boolean
    *** PROBLEM HERE ***
    end function THANX FOR HELP ! =)

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    the ObjPtr() function will help you. this returns a 32bit pointer to an object as a long, I'm not sure exactly where it points to, VB objects are COM objects and are a little more complicated than C++ classes. But I'm pretty sure it's the pointer you need for your function

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212

    Thumbs up Thank you !

    Thanks,

    It was exactly what i was looking for.
    I'm doing a class of type (Double linked , Circular with a fake node list).

    I'm still having some problems when I'm adding the first item, but I'm gonna resolve this.

    I'll msg you if i get any other probs !

    Regards,

    el-nino

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