Re: Unfold string array

2020-01-05 Thread JN via Digitalmars-d-learn
On Sunday, 5 January 2020 at 08:21:54 UTC, Teo wrote: All advises are welcome Thank you! For some reason I can't get run.dlang.io to shorten a link... hmm... I'll use ideone. https://ideone.com/EjbhIs It's kind of a naive implementation, there probably is room for improvement but should

Re: How load icon from resource using LoadImage?

2020-01-05 Thread JN via Digitalmars-d-learn
On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote: I am using this code to load icon from local directory, but I want to load icon from resource.res file: wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE| LR_SHARED | LR_LOADTRANSPARENT);

Re: How load icon from resource using LoadImage?

2020-01-05 Thread Rumbu via Digitalmars-d-learn
On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote: I am using this code to load icon from local directory, but I want to load icon from resource.res file: wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE| LR_SHARED | LR_LOADTRANSPARENT); You cannot

Unfold string array

2020-01-05 Thread Teo via Digitalmars-d-learn
I couldn't find by searching this forum the way to do that, so I thought it is better to ask and learn. The data I am trying to unfold is in the form of string array read from a file line by line, like this: string[] lines = [ "key1: valueA", "key2: valueB", "key3: valueC", "\tvalueD",

How load icon from resource using LoadImage?

2020-01-05 Thread Marcone via Digitalmars-d-learn
I am using this code to load icon from local directory, but I want to load icon from resource.res file: wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE| LR_SHARED | LR_LOADTRANSPARENT);

Re: Using tasks without GC?

2020-01-05 Thread Chris Katko via Digitalmars-d-learn
Thanks everyone, looks like i'll have to benchmark myself (which is fine) but I'm always afraid because I know "proper benchmarking is hard. (TM)" Feel free to throw any other side advice in. I'm looking to get a broad perspective on this. Straight up shutting off the garbage collector in

Re: Unfold string array

2020-01-05 Thread Temtaime via Digitalmars-d-learn
On Sunday, 5 January 2020 at 22:39:37 UTC, Teo wrote: On Sunday, 5 January 2020 at 13:37:58 UTC, JN wrote: [...] Thanks for the input. I just realized that I was not precise enough in my description. Apologies for that. My intention is to use std.algorithm, if possible. I read the

Re: Unfold string array

2020-01-05 Thread Teo via Digitalmars-d-learn
On Sunday, 5 January 2020 at 13:37:58 UTC, JN wrote: It's kind of a naive implementation, there probably is room for improvement but should work for start. Thanks for the input. I just realized that I was not precise enough in my description. Apologies for that. My intention is to use

Re: How load icon from resource using LoadImage?

2020-01-05 Thread Marcone via Digitalmars-d-learn
On Sunday, 5 January 2020 at 15:13:17 UTC, Rumbu wrote: On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote: I am using this code to load icon from local directory, but I want to load icon from resource.res file: wndclass.hIcon = LoadImage( NULL, "icon.ico", IMAGE_ICON, 0, 0,