CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Posts
    5

    Function vs. COM

    I have a function with 15 parameters which I have to call often.

    Does having as many parameters slow execution too much? Is it worth it to write a COM object?


  2. #2
    Join Date
    Jan 2000
    Location
    MO, USA
    Posts
    1,506

    Re: Function vs. COM

    If you turn that one function into a COM object, then you have to create the COM object each time you call it (unless you declare it's variable global). In either case, you will still have to pass the 15 parameters to the object. If you were to turn those parameters into properties of the COM object, then you'd have to make an additional 15 calls to the object, decreasing the efficiency of the object.

    In my opinion, no don't convert it. Rather, see if there is any way you can cut down on the number of parameters being passed. Is there any way to derive one of the values from any of the other values being passed?

    Hope this helps a little,

    John

    John Pirkey
    MCSD
    www.ShallowWaterSystems.com
    John Pirkey
    MCSD (VB6)
    http://www.stlvbug.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured