CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    10

    error C2039: 'default' : is not a member of 'System::Array'

    Can someone please explain the the following error to me:

    error C2039: 'default' : is not a member of 'System::Array'

    The error is occurring at the line that is bold...

    I am using Visual C++ 2008 Express and I have the following piece of code:

    Code:
    private: System::Void ParseAndDisplay(mshtml::IHTMLElement ^htmlObj){
    		UNREALDOMViewer ^domViewer = gcnew UNREALDOMViewer();
    		mshtml::IHTMLDOMNode2 ^nodeObj = nullptr;
    		mshtml::IHTMLElement ^childObj = nullptr;
    
    		if (htmlObj->parentElement == nullptr){
    			nodeObj = safe_cast<mshtml::IHTMLDOMNode2^>(domViewer->treeView1->Nodes->Add("k" + htmlObj->sourceIndex, "<" + htmlObj->tagName + ">", 0));
    		}else{
    			nodeObj = safe_cast<mshtml::IHTMLDOMNode2^>(domViewer->treeView1->Nodes->Find("k" + htmlObj->parentElement->sourceIndex, true)[0]->Nodes->Add("k" + htmlObj->sourceIndex, "<" + htmlObj->tagName + ">", ((safe_cast<Array^>(htmlObj->children)->Length == 0) ? 3 : 2)));
    			if (safe_cast<Array^>(htmlObj->children)->Length == 0){
    				nodeObj = safe_cast<mshtml::IHTMLDOMNode2^>(domViewer->treeView1->Nodes->Find("k" + htmlObj->sourceIndex, true)[0]->Nodes->Add("k" + htmlObj->sourceIndex, htmlObj->innerText, 2));
    			}
    		}
    
    		if (safe_cast<Array^>(htmlObj->children)->Length == 0){
    			return; //no children, exit sub
    		}
    
    		//recursion loop
    		for (int index = 0; index < safe_cast<Array^>(htmlObj->children)->Length; ++index){
    			ParseAndDisplay(safe_cast<Array^>(htmlObj->children)[index]);
    		}
    
    		nodeObj = nullptr;
    		childObj = nullptr;
    	}

  2. #2
    Join Date
    Jul 2009
    Posts
    10

    Angry Re: error C2039: 'default' : is not a member of 'System::Array'

    Thanks everyone for your help...

    between the no answers and the constant you're not in the right place...so I go to the place where I was told to go - and I get "this is not the right place for this question"... ...this forum has definitely been well worth my efforts...

    * someone told that this was a waste of time... *

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

    Re: error C2039: 'default' : is not a member of 'System::Array'

    Since I post answers in this forum sometimes, I want to make some out-of-topic note. Understanding your disappointment, I wonder what is the reason to write this stuff in rarely used and over complicated C++/CLI? C# is much more simple and readable. The only reason to use C++/CLI is managed-unmanaged interoperability. Not only wrong forum. First of all, wrong language
    Last edited by Alex F; February 1st, 2010 at 10:04 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured