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. Access Violation

Access Violation

Scheduled Pinned Locked Moved C / C++ / MFC
c++
2 Posts 2 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.
  • U Offline
    U Offline
    Usman Arif
    wrote on last edited by
    #1

    I have created a pointer of a class in the header file of another class & also, i have initialised a constructor of that class using that pointer, but, in a member function of the class whose header contains the declaration of the pointer. now i wanna access other functions of the class (whose pointer variable has been defined already in the header file), but the exception is thrown. the message declares it as "Access Violation". I m working in Visual C++ 6.0. If any one knows the solution, kindly reply me soon. Usman Arif

    C 1 Reply Last reply
    0
    • U Usman Arif

      I have created a pointer of a class in the header file of another class & also, i have initialised a constructor of that class using that pointer, but, in a member function of the class whose header contains the declaration of the pointer. now i wanna access other functions of the class (whose pointer variable has been defined already in the header file), but the exception is thrown. the message declares it as "Access Violation". I m working in Visual C++ 6.0. If any one knows the solution, kindly reply me soon. Usman Arif

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      If you don't post any code, we won't be able to help you... And what do you mean by: Usman Arif wrote: i have initialised a constructor of that class using that pointer, but, in a member function of the class whose header contains the declaration of the pointer and by: Usman Arif wrote: whose pointer variable has been defined already in the header file :doh::doh: If you have an exception that is thrown, it means that your pointer is probably invalid (pointing to 0xcccccc or 0x00000 or something like that...). Have you tried to use the debugger ?

      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