Announcement

Collapse
No announcement yet.

VC++ String^ als globale Variable

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • VC++ String^ als globale Variable

    Hallo Zusammen, ich würde gerne eine globale Variable in Format "String^" erstellen.

    Wenn ich jedoch dass versuche bekomme ich den Fehler:
    Fehler 1 error C3145: "PROTOKOLL_PATH": Eine globale oder statische Variable darf nicht den verwalteten Typ "System::String ^" aufweisen. C:\Temp\CLR\CLR\CLR.cpp 27 1 CLR

    Heißt dass, das eine VC++ - String-Variable gar nicht als globale Variable erstellt werden kann?

    Wenn ja, wie kann ich dann eine std::string - Variable in eine String^ - Variable umwandeln.

    Vielen Dank für Eure Unterstützung.

    Gruß Lerando

  • #2
    System::String ^ str = gcnew System::String(stdstring.c_str());
    Christian

    Comment


    • #3
      Funktioniert prima. Vielen Dank



      Gruß Lerando

      Comment

      Working...
      X