Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [C] cast che non mi viene

    ho il seguente codice :

    codice:
    DWORD aProcesses[1024], cbNeeded, cProcesses;
    unsigned int i;
    ...
    ...
    printf( "%s  (PID: %u)\n", szProcessName, aProcesses[i] );
    ShellExecute( NULL, "open", "pausep.exe", aProcesses[i], NULL, SW_HIDE );
    ...
    ...
    il problema è che shellexecute come quarto argomento vuole un "pointer to a null-terminated string that specifies the parameters to be passed to the application."

    e se lascio il codice così com'è crusha..io non riesco a fare questo cast !! come cacchio faccio ?

    se uso atof mi dice sempre che sbaglio qualcosa...
    del tipo :

    codice:
    char parametro[MAX_PATH];
    ..
    ..
    printf( "%s  (PID: %u)\n", szProcessName, aProcesses[i] );
    parametro = (char)atof(aProcesses[i]);
    ShellExecute( NULL, "open", "pausep.exe", parametro, NULL, SW_HIDE );
    mi dice

    61 C:\Programmi\Dev-Cpp\Progetti\Favilla\main.c
    [Warning] passing arg 1 of `atof' makes pointer from integer without a cast

    e non capisco cosa devo fare..

  2. #2
    ok atof non mi serve perchè ho una DWORD...

    ma come faccio a rendere quella DOWRD leggibile alla shellexecute ?

  3. #3
    l'ho fatto rimbalzare con una sprintf su una stringa
    risolto

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.