Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Winexec (https://www.delphipraxis.net/138312-winexec.html)

aaaaaaaaaa_10 7. Aug 2009 11:45


Winexec
 
Delphi-Quellcode:
Winexec(extractfilepath(application.exename)+'DalosKom.exe', SW_SHOWNORMAL);
Gibt immer Inkompatible Typen : String und PChar aus. Wie kriege ich das umgewandelt?

sirius 7. Aug 2009 11:47

Re: Winexec
 
Zitat:

Zitat von msdn zu WinExec
Note: This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.

Lösung:
Delphi-Quellcode:
PChar(your_string)

aaaaaaaaaa_10 7. Aug 2009 11:48

Re: Winexec
 
Ist es überhaupt ratsam winexec zu verwenden? oder gibts bessere methoden ein programm zu öffnen?

Mithrandir 7. Aug 2009 11:49

Re: Winexec
 
Zitat:

Zitat von aaaaaaaaaa_10
Ist es überhaupt ratsam winexec zu verwenden?

Dem MSDN-Eintrag nach: Äh, nein? :mrgreen:
Zitat:

Zitat von aaaaaaaaaa_10
oder gibts bessere methoden ein programm zu öffnen?

Hier im Forum suchenShellExecute zum Bleistift...

Luckie 7. Aug 2009 13:53

Re: Winexec
 
Zitat:

Zitat von aaaaaaaaaa_10
Ist es überhaupt ratsam winexec zu verwenden? oder gibts bessere methoden ein programm zu öffnen?

Nein. MSDN-Library durchsuchenWinExec ist im System nur noch vorhanden um die Kompatibilität zu 16-Bit Programmen zu gewährleisten. Bei Windows Versionen, die kein 16-Bit mehr unterstützen (Vista 64-Bit), kann es sein, dass Microsoft die Funktion nicht mehr zur Verfügung stellt.

Zitat:

Zitat von Windows SDK
Note This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.



Alle Zeitangaben in WEZ +1. Es ist jetzt 10:47 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz