ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Writing Managed Wrappers with Managed C++
Subject:   Wrapper for unmanaged C++ Template class
Date:   2006-08-16 04:38:39
From:   Seetharam
Hi,


How do I wrap a template C++ class using managed C++.


e.g. I have a native C++ class :
CDynamicStorage<T>


I would like to wrap this class using Managed C++ - generics so that it can be used by a C# client.


generic<typename T>
public ref class CDynamicStore
{
private:
CDynamicStorage<T> *pData;


public:
CDynamicStore(T t)
{
*pData = new CDynamicStorage<T>();
}
....


This code gives me an error
"template type argument cannot use a generic type parameter"


Please advice.


Seetharam