Von VisualStudio.Net C++ 2003 zu VisualStudio c++ 2005
-
Ich habe Quellcodes mit Visual studio C++ 2003 geschrieben.
Wie kann ich diese in Visual studio C++ 2005 laufen lassen?Danke für die Hilfe
-
Managed C++ gar nicht.
-
Versuch sie doch mal zu starten.
Starte vc++ 2005 und öffne das Projekt. Wahrscheinlich wird wie beim Umstieg von 2005 auf 2008 ein Konvertierungsprogramm gestartet...
-
kjlkjlk schrieb:
Managed C++ gar nicht.
Vielleicht kannst du dir Zeit nehmen und den code durchschauen und evtl. unter 2005 ausführen
Könnte anstatt * ein ^ passen?
Vielen DankString *strDateiname; public: String *strSuchtext; String *strErsatztext; bool bRichtung; private: System::Void Form1_Load(System::Object ^ sender, System::EventArgs ^ e) { textBox1->Clear(); strDateiname=String::Empty; strSuchtext=S""; strErsatztext=S""; textBox1->Bounds=this->DisplayRectangle; if (statusBar1->Visible) { textBox1->Height-=toolStripStatusLabel1->Height; } statusBarPanel1->Text=S"Hier können Meldungen erscheinen"; openFileDialog1->InitialDirectory=Application::StartupPath; openFileDialog1->Filter=S"Textdateien (*.txt)|*.txt| Alle Dateien (*.*)|*.*"; saveFileDialog1->InitialDirectory=openFileDialog1-> InitialDirectory; saveFileDialog1->Filter=openFileDialog1->Filter; saveFileDialog1->ValidateNames=true; //nur erlaubte Zeichen statusBarPanel2->Text=S""; } private: System::Void Form1_Closing(System::Object ^ sender, System::ComponentModel::CancelEventArgs ^ e) { if (textBox1->Modified) { switch (MessageBox::Show(S"Änderungen speichern?", S"Anfrage",MessageBoxButtons::YesNoCancel,MessageBoxIcon::Question, MessageBoxDefaultButton::Button1)) { case DialogResult::Yes: try { if (strDateiname==String::Empty) { menuItem8_Click(sender,e); } else { menuItem9_Click(sender,e); } } //try catch (Exception*) { e->Cancel=true; } //catch break; case DialogResult::Cancel: e->Cancel=true; break; } //switch } //if } //Form1_Closing private: System::Void Form1_Resize(System::Object ^ sender, System::EventArgs ^ e) { textBox1->Bounds=this->DisplayRectangle; if (statusBar1->Visible) { textBox1->Height-=toolStripStatusLabel1->Height; } //if } //Form1_Resize private: System::Void textBox1_Enter(System::Object ^ sender, System::EventArgs ^ e) private: System::Void toolStripMenuItem6_Click(System::Object^ sender, System::EventArgs^ e) //Neu { if (textBox1->Modified) { switch (MessageBox::Show(S"Änderungen speichern?", S"Anfrage",MessageBoxButtons::YesNoCancel,MessageBoxIcon::Question, MessageBoxDefaultButton::Button1)) { case DialogResult::Yes: menuItem9_Click(sender,e); break; case DialogResult::Cancel: return; } //switch } //if textBox1->Clear(); zeigeCursorposition(); } //menuItem6_Click private: System::Void toolStripMenuItem7_Click(System::Object ^ sender, System::EventArgs ^ e) //Öffnen { if (openFileDialog1->ShowDialog(this)==DialogResult::OK) { strDateiname=openFileDialog1->FileName; StreamReader* Leser=File::OpenText(strDateiname); while (Leser->Peek()>-1) { textBox1->Text=String::Concat(textBox1->Text,Leser->ReadLine(),Environment::NewLine); } //while Leser->Close(); this->Text=strDateiname; zeigeCursorposition(); } //if } //menuItem7_Click private: System::Void toolStripMenuItem8_Click(System::Object ^ sender, System::EventArgs ^ e) //Speichern { if (strDateiname==String::Empty) { menuItem9_Click(sender,e); } else { if (textBox1->Text->Length==0) { if (System::Windows::Forms::MessageBox::Show(S"Soll wirklich eine leere Datei angelegt werden?",S"Anfrage",MessageBoxButtons::YesNo,MessageBoxIcon::Question,MessageBoxDefaultButton::Button1)==DialogResult::No) { return; } // if } //if StreamWriter* Schreiber=File::CreateText(strDateiname); for (int nI=0;nI<textBox1->Lines->Count;nI++) { Schreiber->WriteLine(textBox1->Lines->Item[nI]); } //for Schreiber->Close(); } //if } //menuItem8_Click private: System::Void toolStripMenuItem9_Click(System::Object ^ sender, System::EventArgs ^ e) //Speichern unter { if (saveFileDialog1->ShowDialog(this)==DialogResult::OK) { strDateiname=saveFileDialog1->FileName; this->Text=strDateiname; menuItem8_Click(sender,e); } //if } //menuItem9_Click private: System::Void toolStripMenuItem14_Click(System::Object ^ sender, System::EventArgs ^ e) { this->Close(); } //menuItem14_Click private: System::Void toolStripMenuItem15_Click(System::Object ^ sender, System::EventArgs ^ e) //Zeilenumbruch { if (menuItem15->Checked) { textBox1->ScrollBars=ScrollBars::Both; textBox1->WordWrap=false; menuItem15->Checked=false; //Statusleiste ggf. einblenden menuItem17->Enabled=true; statusBar1->Visible=menuItem17->Checked; } else { textBox1->ScrollBars=ScrollBars::Vertical; textBox1->WordWrap=true; menuItem15->Checked=true; //Statusleiste ausblenden menuItem17->Enabled=false; toolStripStatusLabel1->Visible=false; } //if Form1_Resize(sender,e); } //menuItem15_Click private: System::Void toolStripMenuItem16_Click(System::Object ^ sender, System::EventArgs ^ e) //Schriftart { fontDialog1->Font=textBox1->Font; if (fontDialog1->ShowDialog(this)==DialogResult::OK) { textBox1->Font=fontDialog1->Font; } //if } //menuItem16_Click private: System::Void toolStripMenuItem17_Click(System::Object ^ sender, System::EventArgs ^ e) //Statusleiste { menuItem17->Checked=!toolStripMenuItem17->Checked; toolStripStatusLabel1->Visible=toolStripMenuItem17->Checked; Form1_Resize(sender,e); //neu Zeichnen } //menuItem17_Click private: System::Void toolStripMenuItem20_Click(System::Object ^ sender, System::EventArgs ^ e) //Rückgängig { textBox1->Undo(); } //menuItem20_Click private: System::Void toolStripMenuItem22_Click(System::Object ^ sender, System::EventArgs ^ e) //Ausschneiden { Clipboard::SetDataObject(textBox1->SelectedText); textBox1->SelectedText=S""; selektierteSchaltflaechen(); } //menuItem22_Click private: System::Void toolStripMenuItem23_Click(System::Object ^ sender, System::EventArgs ^ e) //Kopieren { Clipboard::SetDataObject(textBox1->SelectedText); } //menuItem23_Click private: System::Void toolStripMenuItem24_Click(System::Object ^ sender, System::EventArgs ^ e) //Einfügen { if (Clipboard::GetDataObject()->GetDataPresent(DataFormats::Text)) { textBox1->SelectedText=(Clipboard::GetDataObject()->GetData(DataFormats::Text)->ToString()); } //if selektierteSchaltflaechen(); } //menuItem24_Click private: System::Void toolStripMenuItem25_Click(System::Object ^ sender, System::EventArgs ^ e) //Löschen { textBox1->SelectedText=S""; selektierteSchaltflaechen(); } //menuItem25_Click private: System::Void toolStripMenuItem27_Click(System::Object ^ sender, System::EventArgs ^ e) //Suchen { CFindDialog *pfDialog=new CFindDialog(); pfDialog->Owner=this; pfDialog->Show(); //if (pfDialog->ShowDialog(this)==DialogResult::OK) { // int Position=textBox1->Text->IndexOf(pfDialog->Suchtext); // if (Position>-1) { // textBox1->SelectionStart=Position; // textBox1->SelectionLength=pfDialog->Suchtext->Length; // } //if //} //if } //menuItem27_Click private: System::Void toolStripMenuItem28_Click(System::Object ^ sender, System::EventArgs ^ e) //Weitersuchen { int nPosition=textBox1->SelectionStart+textBox1->SelectionLength-1; if (nPosition>=textBox1->Text->Length) { MessageBox::Show(S"Keine weitere Fundstelle"); return; } //if int nPos; nPos=bRichtung ? textBox1->Text->IndexOf(strSuchtext,nPosition+1):textBox1->Text->LastIndexOf(strSuchtext,nPosition-1); if (nPos>-1) { nPosition=nPos; textBox1->Select(nPosition,strSuchtext->Length); textBox1->ScrollToCaret(); zeigeCursorposition(); } else { MessageBox::Show(S"Keine weitere Fundstelle"); } //if } //toolStripMenuItem28_Click private: System::Void toolStripMenuItem29_Click(System::Object ^ sender, System::EventArgs ^ e) //Ersetzen { CFindReplaceDialog *pfrDialog=new CFindReplaceDialog(); pfrDialog->Owner=this; pfrDialog->Show(); } //menuItem29_Click private: System::Void toolStripMenuItem30_Click(System::Object ^ sender, System::EventArgs ^ e) //Gehe zu { CGeheZu *geheZu=new CGeheZu(); if (geheZu->ShowDialog(this)==DialogResult::OK) { Debug::WriteLine(textBox1->Lines->Item[geheZu->Position]); int nPosition=0; for (int nI=0;nI<geheZu->Position-1;nI++) { Debug::WriteLine(textBox1->Lines->Item[nI]); nPosition+=__try_cast<String*>(textBox1->Lines->Item[nI])->Length+2; } //for textBox1->Select(nPosition,0); textBox1->ScrollToCaret(); } //if } //menuItem30_Click private: System::Void toolStripMenuItem32_Click(System::Object ^ sender, System::EventArgs ^ e) //Alles markieren { textBox1->SelectAll(); selektierteSchaltflaechen(); } //menuItem32_Click private: System::Void toolStripMenuItem33_Click(System::Object ^ sender, System::EventArgs ^ e) //Uhrzeit/Datum { textBox1->SelectedText=DateTime::Now.ToString(S"hh:MM dd.mm.yyyy"); } //menuItem33_Click private: System::Void textBox1_KeyDown(System::Object ^ sender, System::Windows::Forms::KeyEventArgs ^ e) { zeigeCursorposition(); //noch nicht positioniert } //textBox1_KeyDown private: System::Void textBox1_KeyUp(System::Object ^ sender, System::Windows::Forms::KeyEventArgs ^ e) { zeigeCursorposition(); //verzögert selektierteSchaltflaechen(); } //textBox1_KeyUp private: System::Void textBox1_MouseDown(System::Object ^ sender, System::Windows::Forms::MouseEventArgs ^ e) { zeigeCursorposition(); } //textBox1_MouseDown private: System::Void textBox1_MouseUp(System::Object ^ sender, System::Windows::Forms::MouseEventArgs ^ e) { selektierteSchaltflaechen(); } //textBox1_MouseUp private: System::Void selektierteSchaltflaechen() { menuItem20->Enabled=textBox1->CanUndo; if (textBox1->SelectedText->Length>0) { toolStripMenuItem22->Enabled=true; toolStripMenuItem23->Enabled=true; toolStripMenuItem25->Enabled=true; } else { toolStripMenuItem22->Enabled=false; toolStripMenuItem23->Enabled=false; toolStripMenuItem25->Enabled=false; } //if } //selektierteSchaltflaechen public: System::Void zeigeCursorposition() { if (toolStripStatusLabel1->Visible) { int nPosition=textBox1->SelectionStart; int nZeile=0; try { while (__try_cast<String*>(textBox1->Lines->Item[nZeile])->Length<nPosition) { nPosition-=__try_cast<String*>(textBox1->Lines->Item[nZeile])->Length+2; nZeile++; } //while statusBarPanel2->Text=String::Format(S"Zeile {0}, Spalte {1}",__box(nZeile+1),__box(nPosition+1)); } //try catch (Exception*) { statusBarPanel2->Text=String::Format(S"Zeile {0}, Spalte {1}",__box(1),__box(1)); } //catch } //if } //zeigeCursorposition }; //class Form1 }
//namespace R0
-
Da war doch mal die Rede von nem Converter für den Managed C++ kram zu C++/CLI . Ich meine nach langer ankündigung kam da auch was. Ich meine man findet da etwas im Blog von Jochen. Ansonsten kannst Du mal ein wenig in den Beiträgen stöbern, das Thema Managed C++ -> C++/CLI gabs mehrmals hier.
-
Mr X schrieb:
Versuch sie doch mal zu starten.
Konvertieren ist nicht das Problem, sondern die Syntax.
Es muss * durch ^ ersetzt werden(Fehlermeldung des Compilers)
Fehler 1 error C3921: Für die Verwendung von Zeichenfolgen mit S-Präfixen ist die Befehlszeilenoption /clr:oldSyntax erforderlich.
old.Syntax macht mich krank
Das gleiche Problem habe ich beim StreamWriter::YesNo
Vielen Dank!!!!!!!Vielleicht kannst du dir Zeit nehmen und den code durchschauen und evtl. ausführen unter 2005
Könnte anstatt * ein ^ passen?
Vielen DankString *strDateiname; public: String *strSuchtext; String *strErsatztext; bool bRichtung; private: System::Void Form1_Load(System::Object ^ sender, System::EventArgs ^ e) { textBox1->Clear(); strDateiname=String::Empty; strSuchtext=S""; strErsatztext=S""; textBox1->Bounds=this->DisplayRectangle; if (statusBar1->Visible) { textBox1->Height-=toolStripStatusLabel1->Height; } statusBarPanel1->Text=S"Hier können Meldungen erscheinen"; openFileDialog1->InitialDirectory=Application::StartupPath; openFileDialog1->Filter=S"Textdateien (*.txt)|*.txt| Alle Dateien (*.*)|*.*"; saveFileDialog1->InitialDirectory=openFileDialog1-> InitialDirectory; saveFileDialog1->Filter=openFileDialog1->Filter; saveFileDialog1->ValidateNames=true; //nur erlaubte Zeichen statusBarPanel2->Text=S""; } private: System::Void Form1_Closing(System::Object ^ sender, System::ComponentModel::CancelEventArgs ^ e) { if (textBox1->Modified) { switch (MessageBox::Show(S"Änderungen speichern?", S"Anfrage",MessageBoxButtons::YesNoCancel,MessageBoxIcon::Question, MessageBoxDefaultButton::Button1)) { case DialogResult::Yes: try { if (strDateiname==String::Empty) { menuItem8_Click(sender,e); } else { menuItem9_Click(sender,e); } } //try catch (Exception*) { e->Cancel=true; } //catch break; case DialogResult::Cancel: e->Cancel=true; break; } //switch } //if } //Form1_Closing private: System::Void Form1_Resize(System::Object ^ sender, System::EventArgs ^ e) { textBox1->Bounds=this->DisplayRectangle; if (statusBar1->Visible) { textBox1->Height-=toolStripStatusLabel1->Height; } //if } //Form1_Resize private: System::Void textBox1_Enter(System::Object ^ sender, System::EventArgs ^ e) private: System::Void toolStripMenuItem6_Click(System::Object^ sender, System::EventArgs^ e) //Neu { if (textBox1->Modified) { switch (MessageBox::Show(S"Änderungen speichern?", S"Anfrage",MessageBoxButtons::YesNoCancel,MessageBoxIcon::Question, MessageBoxDefaultButton::Button1)) { case DialogResult::Yes: menuItem9_Click(sender,e); break; case DialogResult::Cancel: return; } //switch } //if textBox1->Clear(); zeigeCursorposition(); } //menuItem6_Click private: System::Void toolStripMenuItem7_Click(System::Object ^ sender, System::EventArgs ^ e) //Öffnen { if (openFileDialog1->ShowDialog(this)==DialogResult::OK) { strDateiname=openFileDialog1->FileName; StreamReader* Leser=File::OpenText(strDateiname); while (Leser->Peek()>-1) { textBox1->Text=String::Concat(textBox1->Text,Leser->ReadLine(),Environment::NewLine); } //while Leser->Close(); this->Text=strDateiname; zeigeCursorposition(); } //if } //menuItem7_Click private: System::Void toolStripMenuItem8_Click(System::Object ^ sender, System::EventArgs ^ e) //Speichern { if (strDateiname==String::Empty) { menuItem9_Click(sender,e); } else { if (textBox1->Text->Length==0) { if (System::Windows::Forms::MessageBox::Show(S"Soll wirklich eine leere Datei angelegt werden?",S"Anfrage",MessageBoxButtons::YesNo,MessageBoxIcon::Question,MessageBoxDefaultButton::Button1)==DialogResult::No) { return; } // if } //if StreamWriter* Schreiber=File::CreateText(strDateiname); for (int nI=0;nI<textBox1->Lines->Count;nI++) { Schreiber->WriteLine(textBox1->Lines->Item[nI]); } //for Schreiber->Close(); } //if } //menuItem8_Click private: System::Void toolStripMenuItem9_Click(System::Object ^ sender, System::EventArgs ^ e) //Speichern unter { if (saveFileDialog1->ShowDialog(this)==DialogResult::OK) { strDateiname=saveFileDialog1->FileName; this->Text=strDateiname; menuItem8_Click(sender,e); } //if } //menuItem9_Click private: System::Void toolStripMenuItem14_Click(System::Object ^ sender, System::EventArgs ^ e) { this->Close(); } //menuItem14_Click private: System::Void toolStripMenuItem15_Click(System::Object ^ sender, System::EventArgs ^ e) //Zeilenumbruch { if (menuItem15->Checked) { textBox1->ScrollBars=ScrollBars::Both; textBox1->WordWrap=false; menuItem15->Checked=false; //Statusleiste ggf. einblenden menuItem17->Enabled=true; statusBar1->Visible=menuItem17->Checked; } else { textBox1->ScrollBars=ScrollBars::Vertical; textBox1->WordWrap=true; menuItem15->Checked=true; //Statusleiste ausblenden menuItem17->Enabled=false; toolStripStatusLabel1->Visible=false; } //if Form1_Resize(sender,e); } //menuItem15_Click private: System::Void toolStripMenuItem16_Click(System::Object ^ sender, System::EventArgs ^ e) //Schriftart { fontDialog1->Font=textBox1->Font; if (fontDialog1->ShowDialog(this)==DialogResult::OK) { textBox1->Font=fontDialog1->Font; } //if } //menuItem16_Click private: System::Void toolStripMenuItem17_Click(System::Object ^ sender, System::EventArgs ^ e) //Statusleiste { menuItem17->Checked=!toolStripMenuItem17->Checked; toolStripStatusLabel1->Visible=toolStripMenuItem17->Checked; Form1_Resize(sender,e); //neu Zeichnen } //menuItem17_Click private: System::Void toolStripMenuItem20_Click(System::Object ^ sender, System::EventArgs ^ e) //Rückgängig { textBox1->Undo(); } //menuItem20_Click private: System::Void toolStripMenuItem22_Click(System::Object ^ sender, System::EventArgs ^ e) //Ausschneiden { Clipboard::SetDataObject(textBox1->SelectedText); textBox1->SelectedText=S""; selektierteSchaltflaechen(); } //menuItem22_Click private: System::Void toolStripMenuItem23_Click(System::Object ^ sender, System::EventArgs ^ e) //Kopieren { Clipboard::SetDataObject(textBox1->SelectedText); } //menuItem23_Click private: System::Void toolStripMenuItem24_Click(System::Object ^ sender, System::EventArgs ^ e) //Einfügen { if (Clipboard::GetDataObject()->GetDataPresent(DataFormats::Text)) { textBox1->SelectedText=(Clipboard::GetDataObject()->GetData(DataFormats::Text)->ToString()); } //if selektierteSchaltflaechen(); } //menuItem24_Click private: System::Void toolStripMenuItem25_Click(System::Object ^ sender, System::EventArgs ^ e) //Löschen { textBox1->SelectedText=S""; selektierteSchaltflaechen(); } //menuItem25_Click private: System::Void toolStripMenuItem27_Click(System::Object ^ sender, System::EventArgs ^ e) //Suchen { CFindDialog *pfDialog=new CFindDialog(); pfDialog->Owner=this; pfDialog->Show(); //if (pfDialog->ShowDialog(this)==DialogResult::OK) { // int Position=textBox1->Text->IndexOf(pfDialog->Suchtext); // if (Position>-1) { // textBox1->SelectionStart=Position; // textBox1->SelectionLength=pfDialog->Suchtext->Length; // } //if //} //if } //menuItem27_Click private: System::Void toolStripMenuItem28_Click(System::Object ^ sender, System::EventArgs ^ e) //Weitersuchen { int nPosition=textBox1->SelectionStart+textBox1->SelectionLength-1; if (nPosition>=textBox1->Text->Length) { MessageBox::Show(S"Keine weitere Fundstelle"); return; } //if int nPos; nPos=bRichtung ? textBox1->Text->IndexOf(strSuchtext,nPosition+1):textBox1->Text->LastIndexOf(strSuchtext,nPosition-1); if (nPos>-1) { nPosition=nPos; textBox1->Select(nPosition,strSuchtext->Length); textBox1->ScrollToCaret(); zeigeCursorposition(); } else { MessageBox::Show(S"Keine weitere Fundstelle"); } //if } //toolStripMenuItem28_Click private: System::Void toolStripMenuItem29_Click(System::Object ^ sender, System::EventArgs ^ e) //Ersetzen { CFindReplaceDialog *pfrDialog=new CFindReplaceDialog(); pfrDialog->Owner=this; pfrDialog->Show(); } //menuItem29_Click private: System::Void toolStripMenuItem30_Click(System::Object ^ sender, System::EventArgs ^ e) //Gehe zu { CGeheZu *geheZu=new CGeheZu(); if (geheZu->ShowDialog(this)==DialogResult::OK) { Debug::WriteLine(textBox1->Lines->Item[geheZu->Position]); int nPosition=0; for (int nI=0;nI<geheZu->Position-1;nI++) { Debug::WriteLine(textBox1->Lines->Item[nI]); nPosition+=__try_cast<String*>(textBox1->Lines->Item[nI])->Length+2; } //for textBox1->Select(nPosition,0); textBox1->ScrollToCaret(); } //if } //menuItem30_Click private: System::Void toolStripMenuItem32_Click(System::Object ^ sender, System::EventArgs ^ e) //Alles markieren { textBox1->SelectAll(); selektierteSchaltflaechen(); } //menuItem32_Click private: System::Void toolStripMenuItem33_Click(System::Object ^ sender, System::EventArgs ^ e) //Uhrzeit/Datum { textBox1->SelectedText=DateTime::Now.ToString(S"hh:MM dd.mm.yyyy"); } //menuItem33_Click private: System::Void textBox1_KeyDown(System::Object ^ sender, System::Windows::Forms::KeyEventArgs ^ e) { zeigeCursorposition(); //noch nicht positioniert } //textBox1_KeyDown private: System::Void textBox1_KeyUp(System::Object ^ sender, System::Windows::Forms::KeyEventArgs ^ e) { zeigeCursorposition(); //verzögert selektierteSchaltflaechen(); } //textBox1_KeyUp private: System::Void textBox1_MouseDown(System::Object ^ sender, System::Windows::Forms::MouseEventArgs ^ e) { zeigeCursorposition(); } //textBox1_MouseDown private: System::Void textBox1_MouseUp(System::Object ^ sender, System::Windows::Forms::MouseEventArgs ^ e) { selektierteSchaltflaechen(); } //textBox1_MouseUp private: System::Void selektierteSchaltflaechen() { menuItem20->Enabled=textBox1->CanUndo; if (textBox1->SelectedText->Length>0) { toolStripMenuItem22->Enabled=true; toolStripMenuItem23->Enabled=true; toolStripMenuItem25->Enabled=true; } else { toolStripMenuItem22->Enabled=false; toolStripMenuItem23->Enabled=false; toolStripMenuItem25->Enabled=false; } //if } //selektierteSchaltflaechen public: System::Void zeigeCursorposition() { if (toolStripStatusLabel1->Visible) { int nPosition=textBox1->SelectionStart; int nZeile=0; try { while (__try_cast<String*>(textBox1->Lines->Item[nZeile])->Length<nPosition) { nPosition-=__try_cast<String*>(textBox1->Lines->Item[nZeile])->Length+2; nZeile++; } //while statusBarPanel2->Text=String::Format(S"Zeile {0}, Spalte {1}",__box(nZeile+1),__box(nPosition+1)); } //try catch (Exception*) { statusBarPanel2->Text=String::Format(S"Zeile {0}, Spalte {1}",__box(1),__box(1)); } //catch } //if } //zeigeCursorposition }; //class Form1 }
//namespace R02008 ein Konvertierungsprogramm gestartet...
-
Google spuckt exakt 1 Ergebnis aus, wenn man nach S Präfix und clr:old sucht. (Da ist die Auswahl recht gering.)
http://msdn2.microsoft.com/de-de/library/b23b94s7(VS.80).aspx
Ein bisschen Eigeninitiative darfst gern zeigen.
http://msdn2.microsoft.com/de-de/library/ms235289(VS.80).aspx
-
Knuddlbaer schrieb:
Da war doch mal die Rede von nem Converter für den Managed C++ kram zu C++/CLI . Ich meine nach langer ankündigung kam da auch was. Ich meine man findet da etwas im Blog von Jochen. Ansonsten kannst Du mal ein wenig in den Beiträgen stöbern, das Thema Managed C++ -> C++/CLI gabs mehrmals hier.
wo finde ich Blog von Jochen?
-
-
Knuddlbaer schrieb:
Vielen Dank für den Link!
Leider wird die Syntax immer noch nicht angenommen! Warum? Was muss ich beachten?
Bitte nochmal helfen!
Danke
-
Du hast alle notwendigen Links erhalten um die Syntax von Managed C++ zu C++/CLI zu bringen. Lesen musst Du schon selbst.
Du kannst gerne gezielt eine Fehlermeldung mit der dazugehörigen Zeile posten, aber es wird Dir keiner mit hellseherischen Fähigkeiten sagen können was Du da treibst.
-
Wenn Du Dir die Mühe sparen willst alles von "Managed C++" nach "C++/CLI" zu konvertieren, dann kannst Du einfach in den Projekteinstellungen den Schakter "/clr:oldSyntax" verwenden!
Damit wird die bisherige Syntax verwendet.
-
hallo,
ich habe ebenfalls ein problem mit clr. ich wollte das ganze von der alten syntax in die neue umschreiben - von 200 fehlern bleiben jetzt noch 11...
hat vielleicht jemand eine ahnung wie ich das
protected: void Dispose(Boolean disposing) { if (disposing && components) { components->~IContainer(); } Dispose(disposing); }
(error C2605) ändern muss bzw. einen destructor dafür definiere?
ein weiteres problem:
wieso kann ich nicht convert::tobyte machen?
private: System::Void buttonConnect_Click_1(System::Object^ sender, System::EventArgs^ e) { if(!bTheConnected) { IFormatProvider^ pcIFormatProvider = NULL; UCHAR ucUSB; USHORT usBaud = 57600; if(comboANTChip->Text->Equals("AP1")) usBaud = 50000; ucUSB = comboUSBPort->Text->ToByte(pciFormatProvider); if(ucUSB > 4) ucUSB = 0; ....
fehler: ( error C2440: 'Initialisierung': 'int' kann nicht in 'System::IFormatProvider ^' konvertiert werden
1> Es ist kein benutzerdefinierter Konvertierungsoperator verfügbar, oder
1> Es ist keine Standardkonvertierung von der mittels Boxing geschachtelten Form des arithmetischen Typs in den Zieltyp vorhanden.
error C2039: 'ToByte': Ist kein Element von 'System::String'...)thanx
martin
-
Anstelle von
IFormatProvider^ pcIFormatProvider = NULL;
mal mit
IFormatProvider^ pcIFormatProvider = nullptr;
probieren.
Simon
-
thanx - IFormatProvider^ funkt jetzt. nun bleibt mir noch folgendes
wieso bekomme ich bei dem code
ucUSB = comboUSBPort->Text->ToByte(pcIFormatProvider);
error C2039: 'ToByte': Ist kein Element von 'System::String'?
thanx
martin
-
sojahulk schrieb:
ucUSB = comboUSBPort->Text->ToByte(pcIFormatProvider);
error C2039: 'ToByte': Ist kein Element von 'System::String'?
martin
Konvertiere den String zu Bytes mit Hilfe der Encoding Klasse.
Simon
-
Hallo,
sojahulk schrieb:
thanx - IFormatProvider^ funkt jetzt. nun bleibt mir noch folgendes
wieso bekomme ich bei dem code
ucUSB = comboUSBPort->Text->ToByte(pcIFormatProvider);
error C2039: 'ToByte': Ist kein Element von 'System::String'?
thanx
martinUnd warum soll Convert nicht funktionieren?:
ucUSB = System::Convert::ToByte(comboUSBPort->Text, pcIFormatProvider);
MfG,
Probe-Nutzer