c++ cli - C++/CLI I can't add a class to my collection -


I'm just trying to add a FilterInfo class to my FilterInfo collection. I have had a terrible time trying to understand why the following code enters the error:

System :: Archive :: Generic :: List :: Add ': parameter 1 is called' I'm just learning C ++ / CLI, because I'm a C # developer, and I'm sure it's something simple, Ziz :: Filter Infos * 'to' Ziz :: Filter Infos'

But I'm sure that some points can be used to strip me down the code Described below are:

  public denomination FilterInfo {public: char * address; }; Public Refine Class Zeez {Private: List & lt; Filter Info & gt; ^ _blacklist; Public: // Constructor Zeese () {_blockList = gcnew list & amp; ;; Filter Info & gt; (); } List & lt; FilterInfo & gt; ^ (GetBlockList) {_packetFilter-> gtb Alliance (> GetBlockList () in the _IPFILTERINFO IP) {// _IPFILTERINFO} is the original C ++ structure FilterInfo * f = new FilterInfo (); _blockList-> Couple (f); } Return _black list; }  

declared you as _blockList

  List & lt; Filterinfo & gt; ^ _blacklist;  

But you are trying to add

  FilterInfo * f  

. It can not work because there is an indicator and the other is a reference.

I'm not sure how "value" fits in but

  public value class FilterInfo {public: four * address; };  

Before you declare an unmanaged category to manage, you must

  public reef class FiterInfo  

This will allow you to explicitly use FilterInfo * to manage memory.

Finally, CR is not very good at C ++ / CLI, I have System :: String


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -