1 Replies - 902 Views - Last Post: 20 April 2011 - 04:31 PM Rate Topic: -----

#1 Aldahbra  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 02-January 10

User Interface for C++ program using C++ Windows Form Application

Posted 20 April 2011 - 04:00 PM

I wrote a program in c++ comand line and now I want to rewrite it to provide a user interface. I have to use C++ because it is part of an assignment and that is what I must use.

I have searched the internet and there is very little information about this and I keep getting sent to Visual Basic or c# sites for information.

My problem is this I have a text box on my form and I want to enter the text from the text box to use in the program.

I was told that
string formula = textBox1->Text;
was the code for extracting the string. But I get to the following error:

Form1.h(121): error C2440: 'initializing' : cannot convert from 'System::String ^' to 'std::basic_string<_Elem,_Traits,_Ax>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]

on the MSDN site it says that you can use the Marsheling library, however, it does not say how. Where would the code go?

I have tried using the header "marshal.h" but I get an error message to say that directory is not found.

I would really appriciate any help at all on this.

Is This A Good Question/Topic? 0
  • +

Replies To: User Interface for C++ program using C++ Windows Form Application

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6081
  • View blog
  • Posts: 23,557
  • Joined: 23-August 08

Re: User Interface for C++ program using C++ Windows Form Application

Posted 20 April 2011 - 04:31 PM

Do not open duplicate topics. I moved your topic to CLI C++. Please continue this conversation there.

Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1