Visual C++ 2008- from system::String to boost::any ?

Excuse me,
I' m reading a DataGridView with VisualC++2008 with nested loops....
.....
Object^ val=dataGridView1[x,y]->Value; //Object is a Visual class
.....
I convert every value in a System::String variable:
String^ str=val->ToString();
Then I'have to insert this data in a container (for example) this:
vectorboost::any* vec=new vectorboost::any(n) ;
//0<=x

On Wed, May 28, 2008 at 12:19 AM, Fox Fossati
Excuse me, I' m reading a DataGridView with VisualC++2008 with nested loops.... ..... Object^ val=dataGridView1[x,y]->Value; //Object is a Visual class ..... I convert every value in a System::String variable: String^ str=val->ToString();
Then I'have to insert this data in a container (for example) this: vectorboost::any* vec=new vectorboost::any(n) ; //0<=x
Is there another method to transfer a value from a dataGridView to an STL container? Now i wrote only a vector to explain simply but in fact i will use a table of this type vector
boost:.any*>.
Your code is C++/CLI. So, you can use System::Object instead of boost::any.
And also, cliext::vector instead of std::vector. Because native class
(such as boost::any,
std::vector) can't have managed instance.
----
#include
participants (2)
-
Fox Fossati
-
Kurata Sayuri