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. This COM thing is real cool!

This COM thing is real cool!

Scheduled Pinned Locked Moved The Lounge
tutoriallearningcsharpc++com
53 Posts 20 Posters 4 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.
  • N Nish Nishant

    Yipppeee! I wrote my first COM thingie :-) Of course it's only the example in the book. But despite the fact that I knew what to expect I was still thrilled, so thrilled I can't control my excitement. I mean I wrote the DLL, registered it. Then I used it from VB. Cool eh? Then I used it from ASP. Cooler eh? I haven't figured out how to use it from C++ though :-( But damnit, I mean this is so cool. I mean why did MS bother with .NET when they already had this COM thing? I mean, what's the bloody purpose! I am the newbiest COM newbie in this planet currently. But even I can see that it is so damn cool! Yippeee again...... How many COMites are here? Is Mike Dunn the only COMite Guru we have? Or is he still in those final pre-guru stages which take the longest period of time in the Guru attainment procedure? Coli, are you hearing this buddy? I am a COMite now. Halley's COMite :-) Regards COM newbie Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

    M Offline
    M Offline
    Michael P Butler
    wrote on last edited by
    #31

    COM is wonderful. I've been writing COM objects for about four years now. Nish [BusterBoy] wrote: I mean why did MS bother with .NET when they already had this COM thing? I mean, what's the bloody purpose! .NET is based upon COM, without COM then .NET wouldn't exist. Welcome to the COM club. I recommend you read Essential COM by Don Box and Effective COM also by Don Box and if you can find a video of Don Box's COM dance. Michael :-)

    N 1 Reply Last reply
    0
    • N Nish Nishant

      Thanks for the info CG :-) ****Christian Graus wrote: It was hell to get working though That's where the fun is I guess :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

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

      Nish [BusterBoy] wrote: Christian Graus wrote: It was hell to get working though That's where the fun is I guess Of course - if it was easy, failed plumbers would do it for $3 an hour. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

      Sonork ID 100.10002:MeanManOz

      I live in Bob's HungOut now

      N 1 Reply Last reply
      0
      • C Christian Graus

        Kannan Kalyanaraman wrote: Just out of curiosity, what makes you think Lotus Notes sucks... Simple observation. There are entire websites devoted to how bad the UI is, and it's just an unpleasant experience from start to finish. No product has any excuse for requiring training for a group of programmers to learn how to use it to read email. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

        Sonork ID 100.10002:MeanManOz

        I live in Bob's HungOut now

        J Offline
        J Offline
        Jason Hooper
        wrote on last edited by
        #33

        I definately agree. It's the weapon of choice for e-mail at my local college, and we all had a lot of fun laughing at it. - Jason SonorkID: 100.12194 :bob:'s your uncle

        1 Reply Last reply
        0
        • M Michael P Butler

          COM is wonderful. I've been writing COM objects for about four years now. Nish [BusterBoy] wrote: I mean why did MS bother with .NET when they already had this COM thing? I mean, what's the bloody purpose! .NET is based upon COM, without COM then .NET wouldn't exist. Welcome to the COM club. I recommend you read Essential COM by Don Box and Effective COM also by Don Box and if you can find a video of Don Box's COM dance. Michael :-)

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #34

          Michael P Butler wrote: .NET is based upon COM, without COM then .NET wouldn't exist Can you elaborate more on that statement? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

          M 1 Reply Last reply
          0
          • C Christian Graus

            Nish [BusterBoy] wrote: Christian Graus wrote: It was hell to get working though That's where the fun is I guess Of course - if it was easy, failed plumbers would do it for $3 an hour. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

            Sonork ID 100.10002:MeanManOz

            I live in Bob's HungOut now

            N Offline
            N Offline
            Nish Nishant
            wrote on last edited by
            #35

            ****Christian Graus wrote: Of course - if it was easy, failed plumbers would do it for $3 an hour In Indian money that'd be a pretty decent amount of money :-) Rs 138/hr :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

            C 1 Reply Last reply
            0
            • N Nish Nishant

              kfc wrote: a .NET guru? Joking right? :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

              B Offline
              B Offline
              BlameUS
              wrote on last edited by
              #36

              No, I am not joking. Considering the number of C# articles under your name, who else on this site is more qualified for the guru title? ;)

              N 1 Reply Last reply
              0
              • B BlameUS

                No, I am not joking. Considering the number of C# articles under your name, who else on this site is more qualified for the guru title? ;)

                N Offline
                N Offline
                Nish Nishant
                wrote on last edited by
                #37

                :-( I can feel the strong pungent scents of heavy sarcasm blowing hard into my face :-( Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                C B 2 Replies Last reply
                0
                • N Nish Nishant

                  ****Christian Graus wrote: Of course - if it was easy, failed plumbers would do it for $3 an hour In Indian money that'd be a pretty decent amount of money :-) Rs 138/hr :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

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

                  Nish [BusterBoy] wrote: In Indian money that'd be a pretty decent amount of money Really ? I presume you mean US$ ( AU$5.50 an hour ), but even then - I make a bit over AU$20 an hour and I make half what I'd expect to make if I moved to the mainland, at a minimum. No wonder people keep posting for Indian programmers. I know if I needed any work done, I'd pay you US$3 an hour in a second, then lie awake at night feeling guilty that it was so, so little. I don't think anyone beyond street mimes and paper boys get $3 an hour, it's just my standard response, as in when I get poor service from McDonalds or the local supermarket I will call the manager and say 'I know it's hard getting decent staff when you pay $3 an hour, but...', or if my daughter doesn't get her toy with her happy meal, I tell her it's because the people who work there are monkeys who work for $3 an hour. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

                  Sonork ID 100.10002:MeanManOz

                  I live in Bob's HungOut now

                  N 1 Reply Last reply
                  0
                  • N Nish Nishant

                    :-( I can feel the strong pungent scents of heavy sarcasm blowing hard into my face :-( Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

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

                    Nish [BusterBoy] wrote: I can feel the strong pungent scents of heavy sarcasm blowing hard into my face I learned something this week, Nish. I went for a job interview, and after a couple of C++ questions, which I answered as expansively as I could, the guy said 'well the rest of my questions are going to sound pretty lame then'. He asked a few, but they quickly decided I knew enough not to bother asking any more. What did I learn ? I'd always assumed I was a bit below anyone who had a degree in my knowledge, in fact my main reason in going for the job was just to see if I could make any sort of impression at all. It seems to me if you're working hard to learn something, you may find that you know more than you think. Don't get me wrong, if Michael Dunn, for example, went for this job, I would not have a chance in hell, but I seem to be doing better than I thought. You are too - when I finally learn C#, I intend to read your articles, and to hope you answer my questions, the way I always hoped to see Michael answer my COM ones. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

                    Sonork ID 100.10002:MeanManOz

                    I live in Bob's HungOut now

                    1 Reply Last reply
                    0
                    • N Nish Nishant

                      :-( I can feel the strong pungent scents of heavy sarcasm blowing hard into my face :-( Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                      B Offline
                      B Offline
                      BlameUS
                      wrote on last edited by
                      #40

                      Nish wrote: "I can feel the strong pungent scents of heavy sarcasm blowing hard into my face" Sorry, Nish. I wasn't trying to make fun of you. I know too little about .NET and C#, the number of articles is my only measure to judge the guruness of another person. :) :) :) The fact that you have evolved into a COM newbie says that you have a very bright future ahead of you. :) :) :)

                      1 Reply Last reply
                      0
                      • N Nish Nishant

                        Michael P Butler wrote: .NET is based upon COM, without COM then .NET wouldn't exist Can you elaborate more on that statement? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                        M Offline
                        M Offline
                        Michael P Butler
                        wrote on last edited by
                        #41

                        I'll leave it to the experts to elaborate, they can probably explain it better than I can http://msdn.microsoft.com/msdnmag/issues/1200/com/com1200.asp Michael :-)

                        1 Reply Last reply
                        0
                        • N Nish Nishant

                          Yipppeee! I wrote my first COM thingie :-) Of course it's only the example in the book. But despite the fact that I knew what to expect I was still thrilled, so thrilled I can't control my excitement. I mean I wrote the DLL, registered it. Then I used it from VB. Cool eh? Then I used it from ASP. Cooler eh? I haven't figured out how to use it from C++ though :-( But damnit, I mean this is so cool. I mean why did MS bother with .NET when they already had this COM thing? I mean, what's the bloody purpose! I am the newbiest COM newbie in this planet currently. But even I can see that it is so damn cool! Yippeee again...... How many COMites are here? Is Mike Dunn the only COMite Guru we have? Or is he still in those final pre-guru stages which take the longest period of time in the Guru attainment procedure? Coli, are you hearing this buddy? I am a COMite now. Halley's COMite :-) Regards COM newbie Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                          J Offline
                          J Offline
                          Jim A Johnson
                          wrote on last edited by
                          #42

                          EEeewww. COM Sucks. That's not a childish put-down; it's a succinct technical assessment.

                          M 1 Reply Last reply
                          0
                          • J Jim A Johnson

                            EEeewww. COM Sucks. That's not a childish put-down; it's a succinct technical assessment.

                            M Offline
                            M Offline
                            Michael P Butler
                            wrote on last edited by
                            #43

                            Any particular area? As somebody who loves the COM programming lifestyle I'd be interested to know why you think it sucks. Michael :-)

                            1 Reply Last reply
                            0
                            • N Nish Nishant

                              Yipppeee! I wrote my first COM thingie :-) Of course it's only the example in the book. But despite the fact that I knew what to expect I was still thrilled, so thrilled I can't control my excitement. I mean I wrote the DLL, registered it. Then I used it from VB. Cool eh? Then I used it from ASP. Cooler eh? I haven't figured out how to use it from C++ though :-( But damnit, I mean this is so cool. I mean why did MS bother with .NET when they already had this COM thing? I mean, what's the bloody purpose! I am the newbiest COM newbie in this planet currently. But even I can see that it is so damn cool! Yippeee again...... How many COMites are here? Is Mike Dunn the only COMite Guru we have? Or is he still in those final pre-guru stages which take the longest period of time in the Guru attainment procedure? Coli, are you hearing this buddy? I am a COMite now. Halley's COMite :-) Regards COM newbie Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                              M Offline
                              M Offline
                              Matt Philmon
                              wrote on last edited by
                              #44

                              Here's some lessons for ya: 1) If your COM object is a STA (Single Threaded Apartment) and you put threads in that apartment, ALWAYS include a message pump. You can add a message pump very easily by adding CWindowImpl to your derivations and adding the message pump. Then, while waiting on your threads to complete their task, process window messages in a loop. Otherwise, you'll freeze. 2) I find that though it's often very tedious and is a nightmare for C++ use of your object, you should usually opt for IDispatch as your interface. IUnknown is much easier and much nicer with types, but limits you heavily (no VB or ASP). 3) If you have a multithreaded STA that uses other STA's, ALWAYS ALWAYS ALWAYS marshal your interfaces. In something like a simple dialog application (MFC) passing around your STA object (smart pointer) by pointer is fine in the same thread. However, don't do this in multithreaded applications. It will work sometimes.... but will often screw you up in hard to find/debug ways. Marshalling is always the way to go and it won't hurt you to use it if you don't need it. 4) If your COM object is written in ATL and IDispatch derived, be prepared to use BSTR and VARIANT's. VB and Scripting simply can't deal with anything else appropriately and you'll frequently find hard to debug problems if you get it working without it. Best of luck! ;)

                              N 1 Reply Last reply
                              0
                              • C Christian Graus

                                Nish [BusterBoy] wrote: In Indian money that'd be a pretty decent amount of money Really ? I presume you mean US$ ( AU$5.50 an hour ), but even then - I make a bit over AU$20 an hour and I make half what I'd expect to make if I moved to the mainland, at a minimum. No wonder people keep posting for Indian programmers. I know if I needed any work done, I'd pay you US$3 an hour in a second, then lie awake at night feeling guilty that it was so, so little. I don't think anyone beyond street mimes and paper boys get $3 an hour, it's just my standard response, as in when I get poor service from McDonalds or the local supermarket I will call the manager and say 'I know it's hard getting decent staff when you pay $3 an hour, but...', or if my daughter doesn't get her toy with her happy meal, I tell her it's because the people who work there are monkeys who work for $3 an hour. Christian I have come to clean zee pooollll. - Michael Martin Dec 30, 2001 Picture the daffodil. And while you do that, I'll be over here going through your stuff. Picture a world without war, without hate. And I can picture us attacking that world, because they would never expect it.

                                Sonork ID 100.10002:MeanManOz

                                I live in Bob's HungOut now

                                N Offline
                                N Offline
                                Nish Nishant
                                wrote on last edited by
                                #45

                                The average Indian software engineer makes between Rs 15,000 to 25,000 per month which is cosidered pretty good here. Lets assume he works 25 days a month averaging 8 hrs a day. That gives us 200 hrs. Thus for 15,000 he makes Rs 75 /hr which is US$ 1.60 and the 25000 guy makes Rs 125 an hr which is USD 2.65 If you offer someone $3 per hr for 200 hrs a month he'd jump for it :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                                R 1 Reply Last reply
                                0
                                • N Nish Nishant

                                  Jon Sagara wrote: Sorry Nish, that was another lame play on words by yours truly. I don't know what the correct terminology is. I know Jon. That's why I put the wink-smiley. I was simply playing along with the joke :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                                  J Offline
                                  J Offline
                                  Jon Hulatt
                                  wrote on last edited by
                                  #46

                                  Didn't you know that Stalin created ATL ? Sorry to dissapoint you all with my lack of a witty or poignant signature.

                                  N 1 Reply Last reply
                                  0
                                  • K Kannan Kalyanaraman

                                    Nish [BusterBoy] wrote: My grammar sucks like Lotus Notes, Just out of curiosity, what makes you think Lotus Notes sucks... Cheers Kannan

                                    D Offline
                                    D Offline
                                    dandy72
                                    wrote on last edited by
                                    #47

                                    Personally, it's Lotus Notes that makes me think Lotus Notes sucks. - DanielD

                                    1 Reply Last reply
                                    0
                                    • N Nish Nishant

                                      The average Indian software engineer makes between Rs 15,000 to 25,000 per month which is cosidered pretty good here. Lets assume he works 25 days a month averaging 8 hrs a day. That gives us 200 hrs. Thus for 15,000 he makes Rs 75 /hr which is US$ 1.60 and the 25000 guy makes Rs 125 an hr which is USD 2.65 If you offer someone $3 per hr for 200 hrs a month he'd jump for it :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                                      R Offline
                                      R Offline
                                      Roger Wright
                                      wrote on last edited by
                                      #48

                                      Before you get any offers, Nish, be sure to stipulate that you have to be allowed to telecommute. If you tried to live here, for instance, on $3/hr, you'd have to live in a ditch, bathe in the river, and the only meal you'd be able to afford would be from McDonald's. And that would only be a couple of meals a week...

                                      A N 2 Replies Last reply
                                      0
                                      • R Roger Wright

                                        Before you get any offers, Nish, be sure to stipulate that you have to be allowed to telecommute. If you tried to live here, for instance, on $3/hr, you'd have to live in a ditch, bathe in the river, and the only meal you'd be able to afford would be from McDonald's. And that would only be a couple of meals a week...

                                        A Offline
                                        A Offline
                                        abc
                                        wrote on last edited by
                                        #49

                                        Let's start a global campaign to get Nish a job in one of the rich countries so that he can contribute to the following items: tax to support George W or Tony B, rent to keep the landlord happy, charity please various churches, education for the next two generations, welfare for the unemployed, healthcare for the poor, defense budget to start a few more wars in the middle-east, ... ;)

                                        N 1 Reply Last reply
                                        0
                                        • R Roger Wright

                                          Before you get any offers, Nish, be sure to stipulate that you have to be allowed to telecommute. If you tried to live here, for instance, on $3/hr, you'd have to live in a ditch, bathe in the river, and the only meal you'd be able to afford would be from McDonald's. And that would only be a couple of meals a week...

                                          N Offline
                                          N Offline
                                          Nish Nishant
                                          wrote on last edited by
                                          #50

                                          By $3/hr I meant working from India. In the US that'd automatically go to $50 an hr Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut

                                          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