How to convert the C# code to equivalent C++/CLI


hi ,

i trying convert below serialize code in c#  to  c++/cli .   please me how that. 

var obj = topicdetails;       var serializer = new system.runtime.serialization.datacontractserializer(typeof(topicdetails));        using (var stream = new system.io.memorystream())                 {                     serializer.writeobject(stream, obj);                      data = new int[stream.length];                     stream.position = 0;                      (int = 0; < data.length; i++)                         data[i] = stream.readbyte();                 }
//here topicdetails class (data contract) follows.  public class topicdetails {         protected object baseobjecttype;  //string         protected object topic;            //string          public topicdetails();           [datamember]         public object baseobjecttype { get; set; }         [datamember]         public object topicid { get; set; }           public static topicdetails createtopic<t, mt>(icomparable<t> objecttype, icomparable<mt> objectid); }                                                                    //topicdetails data-contract createsubscriptions(topicdetails);  //topicdetails data-contract createsubscriptions<list<topicdetails>(topicdetails);          


thanks,
sudhakar


sudhakar mandaleeka


you might need make tweak or two:

auto obj = topicdetails;  auto serializer = gcnew system::runtime::serialization::datacontractserializer(topicdetails::typeid);  auto stream = gcnew system::io::memorystream(); try { 	serializer->writeobject(stream, obj);  	data = gcnew array<int>(stream->length); 	stream->position = 0;  	for (int = 0; < data->length; i++) 	{ 		data[i] = stream->readbyte(); 	} } { 	delete stream; }


convert between vb, c#, c++, & java (http://www.tangiblesoftwaresolutions.com)
instant c# - vb c# converter
instant vb - c# vb converter



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'