Re: Create Windows "shortcut" (.lnk) with D?

2016-03-06 Thread John via Digitalmars-d-learn
On Sunday, 6 March 2016 at 03:13:23 UTC, 岩倉 澪 wrote: IShellLinkA* shellLink; IPersistFile* linkFile; Any help would be highly appreciated as I'm new to Windows programming in D and have no idea what I'm doing wrong! In D, interfaces are references, so it should be: IShellLinkA

Re: If stdout is __gshared, why does this throw / crash?

2016-03-06 Thread Atila Neves via Digitalmars-d-learn
On Sunday, 6 March 2016 at 01:28:52 UTC, Marco Leise wrote: Got it now: https://issues.dlang.org/show_bug.cgi?id=15768 writeln() creates a copy of the stdout struct in a non thread-safe way. If stdout has been assigned a File struct created from a file name this copy includes a "racy"

Re: If stdout is __gshared, why does this throw / crash?

2016-03-06 Thread Atila Neves via Digitalmars-d-learn
On Sunday, 6 March 2016 at 01:10:58 UTC, Anon wrote: On Saturday, 5 March 2016 at 14:18:31 UTC, Atila Neves wrote: [...] Note that `1000.iota.parallel` does *not* run 1000 threads. `parallel` just splits the work of the range up between the worker threads (likely 2, 4, or 8, depending on

is module ( std.experimental.logger) thread-safe.

2016-03-06 Thread Dsby via Digitalmars-d-learn
I want to use the filelogger to my application. is the sharedLog() global and thread-safe.

Re: Had not Dllimport in D?

2016-03-06 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 6 March 2016 at 14:12:35 UTC, xky wrote: First, I really sorry my bad english. I just want to using Ruby dll file(msvcrt-ruby220.dll). D can import and use functions from a DLL but you are using a C# library, which is probably not going to work. D can only call functions from

Re: Had not Dllimport in D?

2016-03-06 Thread Rikki Cattermole via Digitalmars-d-learn
Okay, since you clearly have not worked in a native language before, lets start from scratch. You want to make some bindings to a shared library called "msvcrt-ruby18". From this I know that it is using the Microsoft Visual C runtime. That means you must build D using this as well. This is

Re: Had not Dllimport in D?

2016-03-06 Thread xky via Digitalmars-d-learn
On Sunday, 6 March 2016 at 14:20:34 UTC, WebFreak001 wrote: On Sunday, 6 March 2016 at 14:12:35 UTC, xky wrote: First, I really sorry my bad english. I just want to using Ruby dll file(msvcrt-ruby220.dll). D can import and use functions from a DLL but you are using a C# library, which is

Re: Had not Dllimport in D?

2016-03-06 Thread Rikki Cattermole via Digitalmars-d-learn
On 07/03/16 4:19 AM, xky wrote: On Sunday, 6 March 2016 at 14:21:55 UTC, Rikki Cattermole wrote: Okay, since you clearly have not worked in a native language before, lets start from scratch. [...] Sorry for my idiot question. Thanks. Not idiot, its just where you are at and that's ok :)

Is there a standard for whar opAssign/opOpAssign should return?

2016-03-06 Thread HSteffenhagen via Digitalmars-d-learn
In the https://dlang.org/spec/operatoroverloading.html opAssign is declared as void opAssign(S rhs); in the example. From C++ I'm used to return *this when overloading assignment operators to allow chaining of assignments (or somewhat more rarely, weird tricks for if and while statements),

Had not Dllimport in D?

2016-03-06 Thread xky via Digitalmars-d-learn
First, I really sorry my bad english. I just want to using Ruby dll file(msvcrt-ruby220.dll). In the case of C#, using System; using System.Collections.Generic; using System.Linq; using System.Text; using

Re: Had not Dllimport in D?

2016-03-06 Thread xky via Digitalmars-d-learn
On Sunday, 6 March 2016 at 14:21:55 UTC, Rikki Cattermole wrote: Okay, since you clearly have not worked in a native language before, lets start from scratch. [...] Sorry for my idiot question. Thanks.

Re: Is there a standard for whar opAssign/opOpAssign should return?

2016-03-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 06, 2016 15:25:46 HSteffenhagen via Digitalmars-d-learn wrote: > In the https://dlang.org/spec/operatoroverloading.html opAssign > is declared as > > void opAssign(S rhs); > > in the example. > > From C++ I'm used to return *this when overloading assignment > operators to allow

Re: Const vs Non const method

2016-03-06 Thread Namespace via Digitalmars-d-learn
On Thursday, 25 February 2016 at 10:59:43 UTC, Rene Zwanenburg wrote: On Thursday, 25 February 2016 at 10:44:49 UTC, Andrea Fontana wrote: Check this simple code: http://dpaste.dzfl.pl/2772c9144f1c I can't understand how to minimize code duplication for function like get(). Of course on real

Re: Create Windows "shortcut" (.lnk) with D?

2016-03-06 Thread 岩倉 澪 via Digitalmars-d-learn
On Sunday, 6 March 2016 at 11:00:35 UTC, John wrote: On Sunday, 6 March 2016 at 03:13:23 UTC, 岩倉 澪 wrote: IShellLinkA* shellLink; IPersistFile* linkFile; Any help would be highly appreciated as I'm new to Windows programming in D and have no idea what I'm doing wrong! In D,