OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Vinay_Balasubramaniam (Vinay_BalasubramaniamSATYAM.COM)
Date: Sun Jul 01 2001 - 23:04:52 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Hi all
    Ya _variant_t and _bstr_t is an ATL wrapper of variant and BSTR but
    CComVariant and CComBSTR is microsoft wrapper of variant and BSTR... there
    is no added advantage of one over other.

    regards
    vinay

    -----Original Message-----
    From: Jai Kishore [mailto:jkishoreQUARK.STPM.SOFT.NET]
    Sent: Monday, July 02, 2001 9:23 AM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: Memory Leaks in MTS components

    Hi All,
    Isn't using classes like _variant_t and _bstr_t a better idea than
    their counter parts like CComVariant And CComBSTR.
    I dunno but I have been using these classes for a prett y long time
    and have never observed any memory leaks.

    Regards.

    Jai

    -----Original Message-----
    From: Vinay_Balasubramaniam [mailto:Vinay_BalasubramaniamSATYAM.COM]
    Sent: Monday, July 02, 2001 9:22 AM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: Memory Leaks in MTS components

    Hi Pradyot
    See the funda is if ur using the same CComVariant varible again and again
    then u need to call .empty else u dont have to.
    ex:
    CComVariant temp
    temp ="fsdf"
    temp.empty();
    temp = "dgdgfgv"

    i hope this clears ur doubt.
    about CComBSTR... u dont have to do .empty the wrapper class does it by
    itself... but for safety sake when u reassign anything back to the same
    variable ... do .empty before that.
    I had faced problem by not doing it

    regards
    vinay

    -----Original Message-----
    From: Pradyot Phadke [mailto:pphadkeMELSTAR.COM]
    Sent: Sunday, July 01, 2001 2:24 PM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: Memory Leaks in MTS components

    Hi Vinay,
    Thanks for prompt reply.
    Some doubts are still there.First is I have put break point at the
    starting of the method so there is no code coming into the picture(that of
    server component).Secondly,the message in the debug output window indicates
    about heap. not stack.The number of these heap messages are there those
    many messageboxes are there.
    finally the action(remedy)I am not very clear.When I declare a var of
    CComVariant/CComBSTR type before using it I need to say ccomvariant.clear()
    or ccombstr.empty()? We call it afterwords. Still not very clear.

    Requesting guidence.
    pradyot.

    Hi
    Ya this is definately due to memory leaks...
    I order to overcome this .. u have to clear all ur CComVariants variable
    which u have used in ur code. Apart from this see that there is no memory
    leaks due to CComBSTR's...
    CComVariants allocate on the stack .. u gotto to do

    CComVariants temp;
    temp.clear();

    before u resue temp..
    this should solve ur problem..

    vinay

    ----------------------------------------------------------------
    Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM

    ----------------------------------------------------------------
    Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM

    ----------------------------------------------------------------
    Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM

    ----------------------------------------------------------------
    Users Guide http://msdn.microsoft.com/workshop/essentials/mail.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM