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. How to include CArray in CxImage libraray

How to include CArray in CxImage libraray

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorial
11 Posts 3 Posters 1 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.
  • V Vaclav

    I need to modify CxImage library function to include CArray as a parameter. I have no clue how to include reference to afxtempl.h in CxImage project library. I am basically asking how to add to current CxImage library. I tried to use plain #include preprocessor directive but I get a error saying that I am trying to include stuff which is already included in window.h header. Using VC 6.0 and MFC. Thanks for your help. Thanks for your help. Vaclav

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #2

    Vaclav wrote:

    I tried to use plain #include preprocessor directive but I get a error saying that I am trying to include stuff which is already included in window.h header.

    If it says that, then it must be there already, surely ? Why do you want to do this ? One way out would be to ditch CArray ( which is crap ) and use std::vector. I doubt that's already been included by windows.h :-) Christian Graus - Microsoft MVP - C++

    realJSOPR 1 Reply Last reply
    0
    • C Christian Graus

      Vaclav wrote:

      I tried to use plain #include preprocessor directive but I get a error saying that I am trying to include stuff which is already included in window.h header.

      If it says that, then it must be there already, surely ? Why do you want to do this ? One way out would be to ditch CArray ( which is crap ) and use std::vector. I doubt that's already been included by windows.h :-) Christian Graus - Microsoft MVP - C++

      realJSOPR Offline
      realJSOPR Offline
      realJSOP
      wrote on last edited by
      #3

      Christian Graus wrote:

      One way out would be to ditch CArray ( which is crap )

      I see people say this all the time. Why is CArray "crap"? ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

      C 1 Reply Last reply
      0
      • V Vaclav

        I need to modify CxImage library function to include CArray as a parameter. I have no clue how to include reference to afxtempl.h in CxImage project library. I am basically asking how to add to current CxImage library. I tried to use plain #include preprocessor directive but I get a error saying that I am trying to include stuff which is already included in window.h header. Using VC 6.0 and MFC. Thanks for your help. Thanks for your help. Vaclav

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #4

        I stopped trying to use CXImage. Instead, I use FreeImage. I find FreeImage easier to use/implement. http://freeimage.sourceforge.net/[^] ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        V 1 Reply Last reply
        0
        • realJSOPR realJSOP

          Christian Graus wrote:

          One way out would be to ditch CArray ( which is crap )

          I see people say this all the time. Why is CArray "crap"? ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #5

          Because it's a quick and dirty array class designed to keep people going until the STL arrived. It was never a long term solution. Sure, it's a container, it will hold stuff. But when you go shopping for a hammer, do you buy the hammer you need today, or the one you can foresee needing in the future ? One day, you're going to want to do something that std::vector supports and CArray doesn't. Or, you'll need to create a container of objects in a non-MFC environment. Two good reasons to learn standard C++, and use vector. Christian Graus - Microsoft MVP - C++

          realJSOPR 1 Reply Last reply
          0
          • C Christian Graus

            Because it's a quick and dirty array class designed to keep people going until the STL arrived. It was never a long term solution. Sure, it's a container, it will hold stuff. But when you go shopping for a hammer, do you buy the hammer you need today, or the one you can foresee needing in the future ? One day, you're going to want to do something that std::vector supports and CArray doesn't. Or, you'll need to create a container of objects in a non-MFC environment. Two good reasons to learn standard C++, and use vector. Christian Graus - Microsoft MVP - C++

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #6

            This isn't an argument describing why CArray is "crap". It's an explanation of why you think it exists. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            C 1 Reply Last reply
            0
            • realJSOPR realJSOP

              This isn't an argument describing why CArray is "crap". It's an explanation of why you think it exists. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #7

              Do you disagree with my suggested reason ? I just now saw someone else advising someone not to use CMap, for the same reasons. And I gave two reasons. Here's another. STL containers all use the same iterators, making it trivial to use data between, say, a list and an array. The MFC containers do not have this ability. Christian Graus - Microsoft MVP - C++

              realJSOPR 1 Reply Last reply
              0
              • C Christian Graus

                Do you disagree with my suggested reason ? I just now saw someone else advising someone not to use CMap, for the same reasons. And I gave two reasons. Here's another. STL containers all use the same iterators, making it trivial to use data between, say, a list and an array. The MFC containers do not have this ability. Christian Graus - Microsoft MVP - C++

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #8

                Christian Graus wrote:

                Do you disagree with my suggested reason ? I just now saw someone else advising someone not to use CMap, for the same reasons.

                But you didn't give a reason that you think CArray (and I suppose all the other MFC collection classes) is "crap". Saying it's "crap" implies that it doesn't do the job it's intended to do, or is rife with bugs, thus making it unusable.

                Christian Graus wrote:

                STL containers all use the same iterators, making it trivial to use data between, say, a list and an array. The MFC containers do not have this ability.

                And I argue that you don't have the burden of managing iterators to traverse a CArray. Does that make the STL vector crap? No. It makes it different. Your arguments sound more generally anti-MFC than anti-CArray. I haven't looked, but aren't the new MFC 7.0-8.0 collection classes wrappers for STL now. I heard CString is supposed to be. I put it to you - CArray isn't "crap", it's just different. It's no less powerful in the hands of someone that knows what it can/can't do. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                C 1 Reply Last reply
                0
                • realJSOPR realJSOP

                  Christian Graus wrote:

                  Do you disagree with my suggested reason ? I just now saw someone else advising someone not to use CMap, for the same reasons.

                  But you didn't give a reason that you think CArray (and I suppose all the other MFC collection classes) is "crap". Saying it's "crap" implies that it doesn't do the job it's intended to do, or is rife with bugs, thus making it unusable.

                  Christian Graus wrote:

                  STL containers all use the same iterators, making it trivial to use data between, say, a list and an array. The MFC containers do not have this ability.

                  And I argue that you don't have the burden of managing iterators to traverse a CArray. Does that make the STL vector crap? No. It makes it different. Your arguments sound more generally anti-MFC than anti-CArray. I haven't looked, but aren't the new MFC 7.0-8.0 collection classes wrappers for STL now. I heard CString is supposed to be. I put it to you - CArray isn't "crap", it's just different. It's no less powerful in the hands of someone that knows what it can/can't do. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #9

                  John Simmons / outlaw programmer wrote:

                  Saying it's "crap" implies that it doesn't do the job it's intended to do, or is rife with bugs, thus making it unusable.

                  You're right. And you'll note, I backtracked a little, as a result. CArray will do what it claims to do, it just does the bare minimum, in a platform dependent manner, when a far superior, cross platform alternative exists.

                  John Simmons / outlaw programmer wrote:

                  And I argue that you don't have the burden of managing iterators to traverse a CArray.

                  How is one line of code a burden ? You can actually iterate through a vector without an iterator, BTW.

                  John Simmons / outlaw programmer wrote:

                  Your arguments sound more generally anti-MFC than anti-CArray.

                  No, MFC was and is a very good windowing framework. It beats the hell out of Win32. But, it's a windowing framework. The containers it has are an afterthought, they are not well designed, and had the compiler been able to handle the STL at the time, they would never have existed.

                  John Simmons / outlaw programmer wrote:

                  I haven't looked, but aren't the new MFC 7.0-8.0 collection classes wrappers for STL now. I heard CString is supposed to be.

                  I'm not sure. CString now is templated, I know that.

                  John Simmons / outlaw programmer wrote:

                  It's no less powerful in the hands of someone that knows what it can/can't do.

                  Yes, I would agree. If you start with the assumption that you'll never need the power or flexibility of vector, if you were only going to use a CArray as a dumb, non cross container compatible lump of stuff, they would essentially both do the same thing. So long as you never coded without MFC. Christian Graus - Microsoft MVP - C++

                  1 Reply Last reply
                  0
                  • realJSOPR realJSOP

                    I stopped trying to use CXImage. Instead, I use FreeImage. I find FreeImage easier to use/implement. http://freeimage.sourceforge.net/[^] ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                    V Offline
                    V Offline
                    Vaclav
                    wrote on last edited by
                    #10

                    I leave you big ego guys for couple of days and look what happened. Can you play nice? Next time I won’t ask. Are you happy? PS CArray and CxImage works just fine for me, no thanks to you. Vaclav

                    realJSOPR 1 Reply Last reply
                    0
                    • V Vaclav

                      I leave you big ego guys for couple of days and look what happened. Can you play nice? Next time I won’t ask. Are you happy? PS CArray and CxImage works just fine for me, no thanks to you. Vaclav

                      realJSOPR Offline
                      realJSOPR Offline
                      realJSOP
                      wrote on last edited by
                      #11

                      Hey, why don't you fuck off. We're having a nice pleasant discussion about it and you don't need to come in here acting like a fucking asshole. ------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

                      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