[so] char * vs LPWSTR

Claudiu Mihail claudiu.bogdan.mihail at gmail.com
Sat Mar 10 08:15:09 EET 2012


De ce nu folosesti CreateProcessA in loc de default-ul CreateProcess (care
defaults to CreateProcessW), care probabil ti se trage de la faptul ca ai
setat flag-ul de Unicode in VS.

Claudiu

2012/3/9 Mihail Costea <mihail.costea90 at gmail.com>

> Salut,
>
> Rulez asta:
> bRet = CreateProcess( NULL,          /* No module name */
>  command->verb->string ,       /* Command line */
>  NULL,          /* Process handle not inheritable */
>  NULL,          /* Thread handle not inheritable */
>  FALSE,         /* Set handle inheritance */
>  0,             /* No creation flags */
>  NULL,          /* Use parent's environment block */
>  NULL,          /* Use parent's starting directory */
>  &si,           /* Pointer to STARTUPINFO structure */
>  &pi);          /* Pointer to PROCESS_INFORMATION */
>
> Si primesc eroarea asta:
> c:\users\student\desktop\tema1\minishell.cpp(160): error C2664:
> 'CreateProcessW' : cannot convert parameter 2 from 'const char *' to
> 'LPWSTR'
> Pica de la acel command->verb->string.
>
> Am incercat diverse solutii de pe internet dar nu am reusit nimic. Pe
> Linux totul imi merge bine si frumos, dar aici un amarat de CreateProcess
> nu functioneaza.
> Nervii imi ajung la maxim, ca si-au gasit unii sa faca rescriere de toate
> tipurile de variabile posibile ca apoi sa nu mai mearga nimic.
> Daca cineva ma poate ajuta as fi fericit. Folosesc masina virtuala de la
> laborator.
>
> Mihai
>
>
> --
> Mihail Costea
> E-mail : mihail.costea90 at gmail.com
> Telephone : +40725245085
>
>
> _______________________________________________
> http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20120310/305e8480/attachment.htm>


More information about the so mailing list