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. The Lounge
  3. A Programming Dilemma

A Programming Dilemma

Scheduled Pinned Locked Moved The Lounge
graphicscsswinformsquestion
37 Posts 17 Posters 8 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.
  • M megaadam

    So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

    ........................ Life is too shor

    M Offline
    M Offline
    Michael Schubert
    wrote on last edited by
    #3

    megaadam wrote:

    #define WIN32_LEAN_AND_MEAN

    You mean this guy doesn't know the content of windows.h by heart?

    1 Reply Last reply
    0
    • M megaadam

      So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

      ........................ Life is too shor

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #4

      I feel your pain. The WIN32_LEAN_AND_MEAN & GDI+ thingie hurt me some years ago. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      M 1 Reply Last reply
      0
      • M megaadam

        So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

        ........................ Life is too shor

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #5

        Good old MFC. :) Next, try adding a message handler for a really uncommon WM_xxx thats NOT in the Class Wizard!

        Morality is indistinguishable from social proscription

        N M 2 Replies Last reply
        0
        • M megaadam

          So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

          ........................ Life is too shor

          S Offline
          S Offline
          Simon P Stevens
          wrote on last edited by
          #6

          megaadam wrote:

          WIN32_LEAN_AND_MEAN

          Sorry, did I miss something. WIN32 is LEAN_AND_MEAN? ;)

          Simon

          1 Reply Last reply
          0
          • M megaadam

            So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

            ........................ Life is too shor

            T Offline
            T Offline
            TheIdleProgrammer
            wrote on last edited by
            #7

            Nothing LEAN_AND_MEAN about Win32... MFC can be such a pain in the arse.

            J 1 Reply Last reply
            0
            • L Lost User

              Good old MFC. :) Next, try adding a message handler for a really uncommon WM_xxx thats NOT in the Class Wizard!

              Morality is indistinguishable from social proscription

              N Offline
              N Offline
              NormDroid
              wrote on last edited by
              #8

              Ah message cracking, you just roll your own.

              All right, you guys, I got eight crates of Ipecac from Mort. All on my tab. Now, whoever goes the longest without puking gets the last piece of pie in the fridge.

              1 Reply Last reply
              0
              • L Lost User

                Good old MFC. :) Next, try adding a message handler for a really uncommon WM_xxx thats NOT in the Class Wizard!

                Morality is indistinguishable from social proscription

                M Offline
                M Offline
                megaadam
                wrote on last edited by
                #9

                Actually not MFC at all. "This guy's" project is pure Win32.

                ........................ Life is too shor

                L 1 Reply Last reply
                0
                • CPalliniC CPallini

                  I feel your pain. The WIN32_LEAN_AND_MEAN & GDI+ thingie hurt me some years ago. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  M Offline
                  M Offline
                  megaadam
                  wrote on last edited by
                  #10

                  My friend thanks you very much. He feels much better now.

                  ........................ Life is too shor

                  1 Reply Last reply
                  0
                  • M megaadam

                    So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

                    ........................ Life is too shor

                    J Offline
                    J Offline
                    JustWorking
                    wrote on last edited by
                    #11

                    Any chance that this guy is You.

                    M 1 Reply Last reply
                    0
                    • J JustWorking

                      Any chance that this guy is You.

                      M Offline
                      M Offline
                      megaadam
                      wrote on last edited by
                      #12

                      What a clever little question! [EDIT] (And no I did not univote you!)

                      ........................ Life is too shor

                      J 1 Reply Last reply
                      0
                      • M megaadam

                        What a clever little question! [EDIT] (And no I did not univote you!)

                        ........................ Life is too shor

                        J Offline
                        J Offline
                        JustWorking
                        wrote on last edited by
                        #13

                        Me too. Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them :sigh:

                        M N R J 4 Replies Last reply
                        0
                        • J JustWorking

                          Me too. Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them :sigh:

                          M Offline
                          M Offline
                          Michael Schubert
                          wrote on last edited by
                          #14

                          Cpianism wrote:

                          Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them

                          You should seek help. You're showing classic symtoms of projection -> http://en.wikipedia.org/wiki/Projection_%28psychology%29[^]

                          1 Reply Last reply
                          0
                          • J JustWorking

                            Me too. Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them :sigh:

                            N Offline
                            N Offline
                            Nagy Vilmos
                            wrote on last edited by
                            #15

                            You are not 'univoted'; that is when a troll just clicks 'vote 1' without reading [probably] You deserve every 1 you get.


                            Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                            T 1 Reply Last reply
                            0
                            • J JustWorking

                              Me too. Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them :sigh:

                              R Offline
                              R Offline
                              Rajesh R Subramanian
                              wrote on last edited by
                              #16

                              Cpianism wrote:

                              Me too. Someone is univoting everyone that I reply too to make them think that I'm the one who is univoting them Sigh

                              Just a thought: What makes you think that anyone in this known world will give you that much importance?

                              “Follow your bliss.” – Joseph Campbell

                              B 1 Reply Last reply
                              0
                              • N Nagy Vilmos

                                You are not 'univoted'; that is when a troll just clicks 'vote 1' without reading [probably] You deserve every 1 you get.


                                Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                                T Offline
                                T Offline
                                Tom Deketelaere
                                wrote on last edited by
                                #17

                                Nagy Vilmos wrote:

                                You deserve every 1 you get.

                                I fail to see why his original reply deserves a 1. Sure he stated the obvious but that doesn't really deserves to be down voted now does it. And yes he has made mistakes (I use the word loosely ) in the past but voting him 1 for that reason only would also be univoting (in my opinion).

                                N 1 Reply Last reply
                                0
                                • T Tom Deketelaere

                                  Nagy Vilmos wrote:

                                  You deserve every 1 you get.

                                  I fail to see why his original reply deserves a 1. Sure he stated the obvious but that doesn't really deserves to be down voted now does it. And yes he has made mistakes (I use the word loosely ) in the past but voting him 1 for that reason only would also be univoting (in my opinion).

                                  N Offline
                                  N Offline
                                  Nagy Vilmos
                                  wrote on last edited by
                                  #18

                                  cplop deserves the e-wedgies for his constant and banal whinging about being down voted when he complains about all the down votes he gets. FFS, if he went to Oz, they'd think he was a Brit!


                                  Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                                  M T 2 Replies Last reply
                                  0
                                  • M megaadam

                                    So this guy I know.... ....decided to chuck out his old GDI drawing code in favor of GDI+. He expected a bit of a threshold but felt confident it would pay off. Off he goes and happily types: #include <gdiplus.h> Just to make sure, he unsuspectingly hits F7. KAZANGO! (a lovely sound effect (from the B.C. cartoons) I haven't used for decades) The compiler explodes with 77 bizare errors. Mostly syntax errors and such. So he [this guy] tries to move that include around (into and out of stdafx.h etc) to make the include work. Different bizare errors but same nightmare. Then begins messing around with the pch [precompiled header] settings. No progress. So he consults his trused old friend, Mr. Google. Mr. Google tells him that many other guys just like him have had similar problems. But none of the solutions Mr. G. suggests makes this guys code compile. So gripping for straws he more or less randomly eyes his stdafx.h. He feels like buying a lottery ticket when he removes the [auto-generated] line: #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers But after two hours of constant pain, he is becoming rather discouraged. And rather apprehensively he presses F7. And it all compiles perfectly fine. He shakes his head in disbelief: "How the :wtf: was I supposed to know that ???"

                                    ........................ Life is too shor

                                    J Offline
                                    J Offline
                                    Jim Crafton
                                    wrote on last edited by
                                    #19

                                    Because pretty much anyone worth their salt knows that you put WIN32_LEAN_AND_MEAN at the top of your header before the windows.h include? That's just standard Microsoft Win32 programming, and has been for about 10+ years. I don't know if it's a requirement for other compiler tool chains.

                                    ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                    M 1 Reply Last reply
                                    0
                                    • T TheIdleProgrammer

                                      Nothing LEAN_AND_MEAN about Win32... MFC can be such a pain in the arse.

                                      J Offline
                                      J Offline
                                      Jim Crafton
                                      wrote on last edited by
                                      #20

                                      This has nothing to do with MFC. It's related to Win32 programming. You'd still use it even if you're project isn't using MFC.

                                      ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                      T 1 Reply Last reply
                                      0
                                      • J Jim Crafton

                                        Because pretty much anyone worth their salt knows that you put WIN32_LEAN_AND_MEAN at the top of your header before the windows.h include? That's just standard Microsoft Win32 programming, and has been for about 10+ years. I don't know if it's a requirement for other compiler tool chains.

                                        ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                        M Offline
                                        M Offline
                                        megaadam
                                        wrote on last edited by
                                        #21

                                        Dude, that is exactly where the WIN32_LEAN_AND_MEAN was. But I had to remove it for GDI+.

                                        ........................ Life is too shor

                                        J D 2 Replies Last reply
                                        0
                                        • J Jim Crafton

                                          This has nothing to do with MFC. It's related to Win32 programming. You'd still use it even if you're project isn't using MFC.

                                          ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                                          T Offline
                                          T Offline
                                          TheIdleProgrammer
                                          wrote on last edited by
                                          #22

                                          My bad. :-O Truth is that I've done a fair bit of C++ but it's all been using MFC, and I don't really know much about using C++ outside of the MFC arena. I'm a more of a C# .net boy really. You know what they say about ASSumptions...

                                          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