Re: Struggling with wchar[] to string conversion

2021-01-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 15:32:12 UTC, Stefan wrote: contains a szExePath member that is a wchar[260]. Converting this to a string succeeds (compiler does not complain) with me32.szExePath.text You need to slice it on length. That default conversion will include all 260 chars. So yo

Re: Struggling with wchar[] to string conversion

2021-01-19 Thread Jack via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 15:32:12 UTC, Stefan wrote: Hi, I am using dmd2.081.1 on windows building a 32 bit executable. I am trying to find out how many instances of the same program are running. Therefor I use the core.sys.windows.tlhelp32 module. With the CreateToolhelp32Snapshot(TH

Struggling with wchar[] to string conversion

2021-01-19 Thread Stefan via Digitalmars-d-learn
Hi, I am using dmd2.081.1 on windows building a 32 bit executable. I am trying to find out how many instances of the same program are running. Therefor I use the core.sys.windows.tlhelp32 module. With the CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0) and Process32First/Process32Next I iter