все дал чехлов String с большой буквы))) ребят как выполнить это на С++?
С#
namespace Teragame.logger
{
public class Log
{
static bool cf = false;
public static void warning(string text)
{
(Application.OpenForms[0] as MainInterface).LogBox.Invoke((MethodInvoker)(deleg ate()
{
if ((Application.OpenForms[0] as MainInterface).LogBox.Text.Length > 0)
{
(Application.OpenForms[0] as MainInterface).LogBox.AppendText(Environment.NewLi ne);
}
(Application.OpenForms[0] as MainInterface).LogBox.AppendText(text);
(Application.OpenForms[0] as MainInterface).LogBox.Select((Application.OpenForm s[0] as MainInterface).LogBox.Text.Length - text.Length, text.Length);
(Application.OpenForms[0] as MainInterface).LogBox.SelectionColor = Color.Yellow;
}));
if (cf) tw.WriteLine(text);
}
C++
namespace Teragame
{
namespace logger
{
class Log
{
private:
static bool cf=false;
public:
static void warning (String text)
{
(dynamic_cast<~MyInterface>(Application::OpenForms[0]))->LogBox->Invoke((MethodInvoker)(delegate()
{
if ((dynamic_cast<MainInterface*>(Application::OpenFo rms[0]))->LogBox->Text.Length > 0)
{
(dynamic_cast<MainInterface*>(Application::OpenFor ms[0]))->LogBox->AppendText("\r\n");
}
(dynamic_cast<MainInterface*>(Application::OpenFor ms[0]))->LogBox->AppendText(text);
(dynamic_cast<MainInterface*>(Application::OpenFor ms[0]))->LogBox->Select((dynamic_cast<MainInterface*>(Application: :OpenForms[0]))->LogBox->Text.Length - text.length(), text.length());
(dynamic_cast<MainInterface*>(Application::OpenFor ms[0]))->LogBox->SelectionColor = Color::Yellow;
}
));
if (cf)
tw->WriteLine(text);
}
Еще чо-то MainInterface не опредиляеться хоть и есть такой класс. Потом если ставлю ~MainInterface то нечего не происходит, то есть не пишет ошибку. Советчик нечего не говорит.
Добавлено через 9 минут
Цитата:
Сообщение от Gattsu
Посмеялся =)
Зачем??
|
получать - знания, навыки, практику. Это с сурсов что выложили.