Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. class member have no valid adress!!please help!

class member have no valid adress!!please help!

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingquestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andreas schaerer
    wrote on last edited by
    #1

    hy, i have written an exe and a dll. the exe uses a class in the dll. in this dll- class i have some CString members. now, when i debug i see the following: in the constructor, everything is fine, all strings got initialized and have valid adresses. now in a subsequent functioncall, every CString Member has the adress 0x000000 except the one who was first declared in the class. i have no idea, what the problem could be! has it something todo with the dll? please help me!! thanx

    V 1 Reply Last reply
    0
    • A andreas schaerer

      hy, i have written an exe and a dll. the exe uses a class in the dll. in this dll- class i have some CString members. now, when i debug i see the following: in the constructor, everything is fine, all strings got initialized and have valid adresses. now in a subsequent functioncall, every CString Member has the adress 0x000000 except the one who was first declared in the class. i have no idea, what the problem could be! has it something todo with the dll? please help me!! thanx

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      Sounds like it is an IDE feature, not C++ design. Kuphryn

      A 1 Reply Last reply
      0
      • V valikac

        Sounds like it is an IDE feature, not C++ design. Kuphryn

        A Offline
        A Offline
        andreas schaerer
        wrote on last edited by
        #3

        hy, sorry, i do not understand your answer at all, could you please explain? thanx, greetz

        V 1 Reply Last reply
        0
        • A andreas schaerer

          hy, sorry, i do not understand your answer at all, could you please explain? thanx, greetz

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          I am saying the problem is with Visual C++ debugger, not your application. Kuphryn

          A 1 Reply Last reply
          0
          • V valikac

            I am saying the problem is with Visual C++ debugger, not your application. Kuphryn

            A Offline
            A Offline
            andreas schaerer
            wrote on last edited by
            #5

            hy, i dont think the problem is the debugger,or how could this be? what am i doing wrong? im working with visual c++ since 2 years now, and never experienced a similar problem. how can i solve the problem?

            D 1 Reply Last reply
            0
            • A andreas schaerer

              hy, i dont think the problem is the debugger,or how could this be? what am i doing wrong? im working with visual c++ since 2 years now, and never experienced a similar problem. how can i solve the problem?

              D Offline
              D Offline
              Daniel Turini
              wrote on last edited by
              #6

              Probably you are doing something like this: (normally more complicated, but the same thing)

              CString *p = NULL;
              p->Trim();

              Calling a method on a NULL pointer may cause the problem you're describing. Trying to make bits uncopyable is like trying to make water not wet. -- Bruce Schneier By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn

              D 1 Reply Last reply
              0
              • D Daniel Turini

                Probably you are doing something like this: (normally more complicated, but the same thing)

                CString *p = NULL;
                p->Trim();

                Calling a method on a NULL pointer may cause the problem you're describing. Trying to make bits uncopyable is like trying to make water not wet. -- Bruce Schneier By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn

                D Offline
                D Offline
                DaFrawg
                wrote on last edited by
                #7

                I think that you don't get the point of what he is asking. I think that he wants to know WHY the subsquents aren't initialized. You are only showing the effect of it, but I think he is AAAARGH-ing about the not-being-constructed of the CString-members in his class. And btw, I have no idea what he could be doing wrong. This is really weird... a member var should be constructed if it shouldn't be a pointer but a physical instance...

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups