OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Amar (Amarjeet.singhKLA-TENCOR.COM)
Date: Tue Mar 12 2002 - 11:51:21 CST

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

    To elobrate
    1) I have a variable BSTR in my vb application, as to be returned
    out,retval.
    when this BSTR is to be returned from component at last stage it is equated
    as BSTR B = _bstr_t.copy();
    the call after returning from component crashes inside vb app.
    same works fine if I use BSTR B = _bstr_t, but idally it should crash in
    this scenerio.
    3)use of mare _bstr_t inside a function crashes the application when is
    tries to return to user.
    If I use BSTR inside same application my function works fine.
    I am taking care of each and every refrence counting and catching exceptions
    too.
    Thanks .
    Amar.
    please these scenerios are not reproducable every time.

    -----Original Message-----
    From: Distributed COM-Based Code [mailto:DCOMDISCUSS.MICROSOFT.COM]On
    Behalf Of Brian Muth
    Sent: Tuesday, March 12, 2002 11:04 PM
    To: DCOMDISCUSS.MICROSOFT.COM
    Subject: Re: Crashing of the _bstr_t

    You have a bug in your program somewhere. I'm not convinced it has
    anything to do with the _bstr_t call, but more likely with interface
    counting. Are you returning an interface pointer anywhere?

    Also, remember that _bstr_t can throw an exception. Are you catching
    them?

    You haven't provided enough information for us to go on.

    >
    > Hi All,
    > Why do it heppen that _bstr_t crashes in the folowing scenerios:
    > 1) It crashes If you use BSTR = _bstr_t.copy(), ideally it shouldn't
    in
    > this case
    > 2) It doesn't crashes if you use BSTR = _bstr_t, it should crash in
    this
    > case.
    > 3) If we have used _bstr_t inside a function for any reason, The
    moment
    > function returns at the closing curly brashes (even though function
    > returns
    > void)it crashes the application .
    > These scenerios are not repeated everytime but are more likely to
    occur.
    > The crashed application takes you to a point in COMIP.H
    >
    > void _Release() throw()
    > {
    > if (m_pInterface != NULL) {
    > m_pInterface->Release();
    > }
    > }
    >

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.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://discuss.microsoft.com/archives/mailfaq.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