Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

AW: Zugriffsverletzung bei Benutzung von Pipes

  Alt 3. Feb 2011, 09:57
Warum machst Du es nicht so:
Memo1.Lines.Add(Dest); und vertraust auf eine implizite Umwandlung?

Gruß
K-H
Weil mir Lines.Add einen Zeilenumbruch einfügt, den ich nicht will.

Schau mal hier:
CreateProcess(nil,PChar(od.FileName),nil,nil,true,CREATE_NEW_CONSOLE,nil,nil,si,pi); Du verwendest sicher Delphi >= 2009? Dann ist CreateProcess = CreateProcessW.

Zitat von http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx:
The Unicode version of this function, CreateProcessW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string). If this parameter is a constant string, the function may cause an access violation.
Du brauchst also ne extra Stringvariable dafür.
Das kann ich machen. Allerdings kracht es ja nicht bei CreateProcess sondern irgendwann während der Prozess schon läuft und ich die Pipes auslese und reinschreibe.
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat