Thread: can "this" fail?

  1. #1
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916

    can "this" fail?

    Using MSVC 6

    I have a class, and I'm relying on the "this" keyword quite a bit to perform some operations. There's a bug in the class, and I've been looking for it for quite a while - it compiles and everything, just doesn't work quite write. I think it's mostly fixed. But I decided to start up the debugger to see if that could help me at all, and in one of the MSVC debugging windows, I got the message
    this CXX0017: Error: symbol "this" not found

    I suspect that it is possible that this is the root of the error, but I have no idea how "this" could not be found... what is it telling me? Are there instances in which you can't use "this," or instances in which it fails?
    Away.

  2. #2
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    The debugger not finding 'this' seems to be something related entirely to the debugger. 'this' is valid anywhere inside the class (i.e., the symbol is defined), and as it compiles, you obviously are not using it anywhere it is not defined. Unless you call 'delete this' (which really shouldn't happen often), 'this' should not be failing... at least not consistently like this.

    Try narrowing the bug down by making functions simply dummy functions until it runs without crashing.

  3. #3
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    AAAAAAAAAHHHH! I want to kill myself! (Volk will be happy...inside joke) I just stepped through for like 30 minutes. I spotted this

    if (previousnode->next=node)

    Everything is now beautiful.
    Away.

  4. #4
    Un Artiste Extraordinaire volk's Avatar
    Join Date
    Dec 2002
    Posts
    357
    >>I want to kill myself!


  5. #5
    Registered User dalek's Avatar
    Join Date
    May 2003
    Posts
    135
    Are there instances in which you can't use "this,"
    Although you have found the problem, it is worth noting that there is an instance where you can't use this.

    You don't get a this pointer with a static member function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Non-blocking socket connection problem
    By cbalu in forum Linux Programming
    Replies: 25
    Last Post: 06-03-2009, 02:15 AM
  2. fail to count digit of an integer (fail at 9)
    By azsquall in forum C++ Programming
    Replies: 3
    Last Post: 05-02-2008, 09:42 AM
  3. bad and fail of steam
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 02-19-2008, 03:07 AM
  4. Reasons as to why fread would fail
    By Happy_Reaper in forum C Programming
    Replies: 4
    Last Post: 04-08-2006, 11:41 AM
  5. Set fail flag in istream
    By *ClownPimp* in forum C++ Programming
    Replies: 0
    Last Post: 03-20-2003, 09:24 PM