Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a Child Process with Redirected Input and Outpu
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00810688
Message ID:
00811436
Vues:
19
GetLastError() returns 6 (invalid handle).
The DuplicateHandle() returns something but it's not a valid handle (it's not a number).
here's some snippet code:

#define true 1
#define false 0
#define DUPLICATE_SAME_ACCESS 2

local hChildStdoutRdDup
hChildStdoutRdDup=REPLICATE(CHR(0),4)

fSuccess = DuplicateHandle(GetCurrentProcess(), hChildStdoutRd,;
GetCurrentProcess(), @hChildStdoutRdDup, false,;
false,;
DUPLICATE_SAME_ACCESS)
but if I set

hChildStdoutRdDup=0

the DuplicateHandle() give me a "Data type mismatch"
have you some suggestions on DuplicateHandle()?

Franco

>Hi Franco,
>
>Your WriteFile call looks Ok. So may be:
>
>1) Check WriteFile declaration
>
>DECLARE INTEGER WriteFile IN kernel32;
>	INTEGER hFile, STRING lpBuffer, INTEGER nBt2Write,;
>	INTEGER @lpBtWritten, INTEGER lpOverlapped
>
>2) Call GetLastError to determine the error more accurately:
>
>DECLARE INTEGER GetLastError IN kernel32
>? GetLastError()
>
>For example, it can be 5=ERROR_ACCESS_DENIED.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform