boost::intrusive_ptr and Managed C++?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Drew

    boost::intrusive_ptr and Managed C++?

    Has anyone used boost's intrusive_ptr with Managed C++ extensions?

    I have a small project where the executable (managed) is linked to a
    native C++ dll.

    The code looks like:

    int _tmain()
    {
    boost::intrusiv e_ptr<Unmanaged > pUn = __nogc new Unmanaged();

    return 0;
    }

    when I exit out of main, boost::intrusiv e_ptr_release() throws an
    exception. The last known method called is:

    UnmanagedLib.dl l!_CrtIsValidHe apPointer(...) Line 1807

    but when I replace my code with:

    Unmanaged* pUm = new Unmanaged();
    delete pUm;

    no exception is thrown.

    Please help!

    -Drew
  • Tian Min Huang

    #2
    RE: boost::intrusiv e_ptr and Managed C++?

    Hello Drew,

    Thanks for your post. I did some research on my side, however, I did not
    find any known issue. What's the version of Boost C++ Libraries you are
    using? You can download the latest at
    http://sourceforge.net/project/showf...?group_id=7586.

    In the meantime, since you are using third-party C++ library, I recommend
    you contact Boost Mailing Lists at
    http://www.boost.org/more/mailing_lists.htm to check this issue.

    Hope this helps.

    Regards,

    HuangTM
    Microsoft Online Partner Support
    MCSE/MCSD

    Get Secure! ¨C www.microsoft.com/security
    This posting is provided ¡°as is¡± with no warranties and confers no rights.


    Comment

    • Drew

      #3
      Re: boost::intrusiv e_ptr and Managed C++?

      I am using 1.30.0. I'll try with 1.30.2.

      Has anyone tried this? I've narrowed down the problem a little more.

      I have two global functions that get called when the intrusive_ptr is
      created/destroyed.

      namespace boost
      {
      void intrusive_ptr_a dd_ref(Unmanage d* pObj);
      void intrusive_ptr_r elease(Unmanage d* pObj);
      }

      If these functions are exported from my unmanaged DLL, it causes the
      problem below. If these functions are in my managed DLL, everything
      works fine.

      Does this help anyone narrow down what's going on?

      Thanks,
      Drew

      timhuang@online .microsoft.com (Tian Min Huang) wrote in message news:<lepToHwZD HA.2260@cpmsftn gxa06.phx.gbl>. ..[color=blue]
      > Hello Drew,
      >
      > Thanks for your post. I did some research on my side, however, I did not
      > find any known issue. What's the version of Boost C++ Libraries you are
      > using? You can download the latest at
      > http://sourceforge.net/project/showf...?group_id=7586.
      >
      > In the meantime, since you are using third-party C++ library, I recommend
      > you contact Boost Mailing Lists at
      > http://www.boost.org/more/mailing_lists.htm to check this issue.
      >
      > Hope this helps.
      >
      > Regards,
      >
      > HuangTM
      > Microsoft Online Partner Support
      > MCSE/MCSD
      >
      > Get Secure! ¨C www.microsoft.com/security
      > This posting is provided ¡°as is¡± with no warranties and confers no rights.[/color]

      Comment

      • Tian Min Huang

        #4
        Re: boost::intrusiv e_ptr and Managed C++?

        Hello Drew,

        As you know, Boose is third-party C++ libarry, I believe that you may be
        best served by contacting Boost directly.

        Please feel free to let me know if you have any problems or concerns.

        Have a nice day!

        Regards,

        HuangTM
        Microsoft Online Partner Support
        MCSE/MCSD

        Get Secure! ¨C www.microsoft.com/security
        This posting is provided ¡°as is¡± with no warranties and confers no rights.


        Comment

        Working...