none
visual c++, cannot use this indirection on type 'System::String'?

    Question

  • hi, I have the following code:

    String * target= "http://buyforless2.yolasite.com";
    try
       {
          Diagnostics::Process::Start(target);
       }
       catch (ComponentModel::Win32Exception * noBrowser) 
       {
          if (noBrowser->ErrorCode==-2147467259)
             Windows::Forms::MessageBox::Show(noBrowser->Message);
       }
       catch (Exception * other)
       {
          Windows::Forms::MessageBox::Show(other->Message);
       } 
    And I get errors:

    1>.\Int_Main.cpp(185) : error C3699: '*' : cannot use this indirection on type 'System::String'
    1>        compiler replacing '*' with '^' to continue parsing
    1>.\Int_Main.cpp(190) : error C3699: '*' : cannot use this indirection on type 'System::ComponentModel::Win32Exception'
    1>        compiler replacing '*' with '^' to continue parsing
    1>.\Int_Main.cpp(195) : error C3699: '*' : cannot use this indirection on type 'System::Exception'
    1>        compiler replacing '*' with '^' to continue parsing

    Any idea how to fix them?
    Tuesday, March 09, 2010 7:47 AM

Answers

  • If you follow the compilers lead with the message
     compiler replacing '*' with '^' to continue parsing

    Then try replacing * with ^?

    If you look at this then you will understand what the issue is.

    I would also suggest you read the entire section of Language Features for Targeting the CLR.
    Visit my (not very good) blog at http://c2kblog.blogspot.com/
    • Proposed as answer by ildjarn Tuesday, March 09, 2010 8:52 AM
    • Marked as answer by Gennady46 Tuesday, March 09, 2010 10:07 PM
    Tuesday, March 09, 2010 7:55 AM