Показать сообщение отдельно
Старый 16.10.2010, 14:48   #6
Nordway
RMDC Donator
 
Регистрация: 07.03.2010
Адрес: Россия
Сообщений: 29
Сказал(а) спасибо: 16
Поблагодарили 18 раз(а) в 3 сообщениях
Nordway На верном пути
По умолчанию

Делал так:

Код:
using namespace System::Runtime::InteropServices;
...
String^ str = textBox1->Text;
IntPtr iptrstr = Marshal::StringToCoTaskMemAnsi(str);
const char* id = static_cast<const char*>(iptrstr.ToPointer());
...
...
Marshal::FreeCoTaskMem(iptrstr);
Ошибки:

Код:
1>c:\documents and settings\nordway\мои документы\visual studio 2008\projects\mysql\mysql\Form1.h(145) : error C2679: binary '+' : no operator found which takes a right-hand operand of type 'const char *' (or there is no acceptable conversion)
1>        could be 'built-in C++ operator+(volatile const System::Object ^, volatile const System::String ^)'
1>        or       'built-in C++ operator+(volatile const System::String ^, volatile const System::Object ^)'
1>        or       'built-in C++ operator+(volatile const System::String ^, volatile const System::String ^)'
1>        while trying to match the argument list '(System::String ^, const char *)'

P.S. Объедините в 1 пост, какой-то глюк с форумом был.
Nordway вне форума   Ответить с цитированием