• Advertisement
Sign in to follow this  

[.net] from String* to String*[] ?

This topic is 4623 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am trying to compile this code(C++ .net), but i couldn't get it to work!
static void AppendText(String* p_Str)
{
String* Line = String::Concat("\r\n", p_Str);

m_Console->richTextBox1->Invoke(new AppendDe(dynamic_cast<TextBoxBase*>
					(m_Console->richTextBox1)
					,&TextBoxBase::AppendText),Line);
}


The compiler shows the following error:
error C2664: 'System::Object __gc *System::Windows::Forms::Control::Invoke(System::Delegate __gc *,System::Object __gc * __gc[])' : cannot convert parameter 2 from 'System::Collections::ArrayList __gc *' to 'System::Object __gc * __gc[]'
        Can only convert a __gc array to or from Object * or Array *


I also tried to write String* Line[] = ... but it didn't work Can anyone help me ? I have been trying to figure out this for almost a hour without any success ;( [Edited by - Jnz86 on June 29, 2005 2:27:12 PM]

Share this post


Link to post
Share on other sites
Advertisement
Side note: please (re)name your post...

Cheers

Share this post


Link to post
Share on other sites
Well, it cannot convert from an ArrayList type to an array. You might want to try calling the ToArray() member of the ArrayList class.

Share this post


Link to post
Share on other sites
Quote:
Original post by Washu
Well, it cannot convert from an ArrayList type to an array. You might want to try calling the ToArray() member of the ArrayList class.


i will try...

Share this post


Link to post
Share on other sites
Quote:
Original post by Jnz86
Quote:
Original post by Washu
Well, it cannot convert from an ArrayList type to an array. You might want to try calling the ToArray() member of the ArrayList class.


i will try...


You are right, it works! :)
Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement