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. STL or <afxtempl.h>

STL or <afxtempl.h>

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
7 Posts 3 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.
  • S Offline
    S Offline
    s o v a n n
    wrote on last edited by
    #1

    Hello! :) I am making MFC application which is divided into many DLL. I am using STL and having problems with "access violation". Should I use <afxtempl.h> instead, or is there anyway to fix that STL error? Your comments would be appriciated. Sovann :)

    B 1 Reply Last reply
    0
    • S s o v a n n

      Hello! :) I am making MFC application which is divided into many DLL. I am using STL and having problems with "access violation". Should I use <afxtempl.h> instead, or is there anyway to fix that STL error? Your comments would be appriciated. Sovann :)

      B Offline
      B Offline
      Bob Stanneveld
      wrote on last edited by
      #2

      Hello, I think that the problem is not with STL or that the collections that the MFC provides will solve the problem. What exactly is your problem? Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

      S 1 Reply Last reply
      0
      • B Bob Stanneveld

        Hello, I think that the problem is not with STL or that the collections that the MFC provides will solve the problem. What exactly is your problem? Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

        S Offline
        S Offline
        s o v a n n
        wrote on last edited by
        #3

        Well, when all in one EXE, everything works just fine. Until we break into many DLL and pass/save pointer back/forth, we come to this "access violation". Most of the crash, we have invalid pointer such as 0xfeeefeee or 0xcccdcccd. Sovann :)

        B 1 Reply Last reply
        0
        • S s o v a n n

          Well, when all in one EXE, everything works just fine. Until we break into many DLL and pass/save pointer back/forth, we come to this "access violation". Most of the crash, we have invalid pointer such as 0xfeeefeee or 0xcccdcccd. Sovann :)

          B Offline
          B Offline
          Bob Stanneveld
          wrote on last edited by
          #4

          Hello, I don't know the exact meaning of those addresses, but they have something to do with uninitialized or already deleted pointers. The rule of thumb is that you do not spread your memory management across different modules, that is, you should not allocate a block in your DLL A and free it in another module. Your problem might be here. Maybe you should make a copy of a memory block when it's saved across module boundraries. Hope this helps. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

          S 1 Reply Last reply
          0
          • B Bob Stanneveld

            Hello, I don't know the exact meaning of those addresses, but they have something to do with uninitialized or already deleted pointers. The rule of thumb is that you do not spread your memory management across different modules, that is, you should not allocate a block in your DLL A and free it in another module. Your problem might be here. Maybe you should make a copy of a memory block when it's saved across module boundraries. Hope this helps. Behind every great black man...             ... is the police. - Conspiracy brother Blog[^]

            S Offline
            S Offline
            s o v a n n
            wrote on last edited by
            #5

            Thank you for your comments. I would reconsider the memory management. Sovann.

            D 1 Reply Last reply
            0
            • S s o v a n n

              Thank you for your comments. I would reconsider the memory management. Sovann.

              D Offline
              D Offline
              Dudi Avramov
              wrote on last edited by
              #6

              Read You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE and How to export an instantiation of a Standard Template Library (STL) class and a class that contains a data member that is an STL object

              S 1 Reply Last reply
              0
              • D Dudi Avramov

                Read You may experience an access violation when you access an STL object through a pointer or reference in a different DLL or EXE and How to export an instantiation of a Standard Template Library (STL) class and a class that contains a data member that is an STL object

                S Offline
                S Offline
                s o v a n n
                wrote on last edited by
                #7

                Thank you very much for your comments. I have read them all. My problem was direct access to STL object in other module. Now I am working on it. Thanks again. Have a nice day! :)

                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