VS2008 C # error ".ctor" not supported by language

C # code:

class Program
{
    static void Main(string[] args)
    { 
        TFWrapper tf;
        String lexDir = ".......";
        String lic = "........";
        String key = ".........";
        ArrayList cats = new ArrayList();
        Boolean useConj = false;
        String lang = "english";
        String encoding = "auto";
        tf = new TFWrapper(lexDir, lic, key, cats, useConj, lang, encoding);
    }
}  

      

C ++ managed method is called:

TFWrapper::TFWrapper(String^ mlexDir, String^ mlic, String^ mkey, ArrayList catList, Boolean^ m_useConj, String^ m_lang, String^ m_encoding);  

      

Getting '.ctor' is not supported by language error in the last line of C #

+2


a source to share


2 answers


Just guess, but I think you need to change

ArrayList catList, Boolean^ m_useConj

      

to



ArrayList^ catList, Boolean m_useConj

      

Because Boolean is a value type and ArrayList is a reference type.

+6


a source


Try calling this in your C #:

tf = new TFWrapper(lexDir, lic, key, cats, useConj, lang, encoding);

      



Also, shouldn't there ArrayList catList

be a C ++ in your declaration ArrayList^ catlist

?

0


a source







All Articles