Re: [Boost-users] Boost-users Digest, Vol 1645, Issue 3

Message: 8 Date: Wed, 28 May 2008 09:18:22 +0900 From: "Kurata Sayuri" <magicalsayuri@gmail.com> Subject: Re: [Boost-users] Visual C++ 2008- from system::String to boost::any ? To: boost-users@lists.boost.org Message-ID: <b09a4ea0805271718vffa0c18m2d2565947fd159e0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On Wed, May 28, 2008 at 12:19 AM, Fox Fossati <stonfofish@yahoo.it> wrote:
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: vector<boost::any>* vec=new vector<boost::any>(n) ; //0<=x<n (*vec)[x]=str; //ERROR! (*vec)[x]=*str; //ERROR!
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<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 <cliext/vector> Object^ val = dataGridView1[x,y]->Value; String^ str = val->ToString(); cliext::vector<Object^>^ vec = gcnew cliext::vector<Object^>(n) ; // or cliext::vector<String^> (*vec)[x]=str; ------------------------------ Is it possible to convert a System::String to an std:string? With a conversion then i can use my boost classes...but i need to convert from std::string to System::String and vice versa.... I should use visual c++ only for interface input/output unless using visual classes....do you think i will have a lot of troubles? It's very difficult to find a good ide rad.... Thanks a lot! ___________________________________ Scopri il Blog di Yahoo! Mail: trucchi, novità, consigli... e la tua opinione! http://www.ymailblogit.com/blog/
participants (1)
-
Fox Fossati