Hello Diwas,

Yes, that's something you cannot get rid of it when you are building with
c++/cli in visual studio.

Our solution was implementing a holder like osg::ref_ptr in .net:

template<typename T>
ref class msclr_refptr { ... }

You can use the osg::ref_ptr class as inspiration to replicate the
behaviour in .NET. Unfortunately I cannot share any code but is pretty
straightforward to do it.

For managing properly the references in C++/CLI and use it in C# (with some
limitations of course), we created some C++/CLI wrappers using internally
the msclr_refptr holder:

ref class CLRGroup {
public:
    // whatever api you want to show
private:
     mslr_refptr<osg::Group> m_Group;
}

I hope this helps.

Regards,
Rafa.


El vie., 1 abr. 2016 a las 12:44, Diwas Bhattarai (<[email protected]>)
escribió:

> Hi,
> Did anybody came accross the problem when working with c#
>
> *Quote:*
>
>
>
>
>
> a member of a managed class cannot be of a non-managed class type
>
>
>
>
> I posted the question in
> http://forum.openscenegraph.org/viewtopic.php?p=66696#66696
>
>
> Thank you!
>
> Cheers,
> Diwas[/quote]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66704#66704
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to