Код | void convert(char a[256],System::EventArgs^ e) { pin_ptr<const wchar_t> wch=PtrToStringChars(e->Text); int sizeInBytes = (e->Text->Length + 1); char *ch = (char *)malloc(sizeInBytes); WideCharToMultiByte(0,0,wch,-1,ch,sizeInBytes,NULL,NULL); for ( int i = 0; i<e->Text->Length; i++ ) { a[i]=ch[i]; } delete ch; }
private: System::Void comboBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { char nono[256]=""; convert(nono,e); }
|
Данный код не работает. Задача - передать comboBox или любой другой компонент в функцию convert.
|