Click to See Complete Forum and Search --> : error C2039: 'default' : is not a member of 'System::Array'


didijc
January 27th, 2010, 11:52 AM
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:


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;
}

didijc
February 1st, 2010, 06:08 AM
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... *

Alex F
February 1st, 2010, 09:01 AM
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 :(