Access violation when using IShellFolder2

2020-09-08 Thread FreeSlave via Digitalmars-d-learn
Consider the following code: import core.sys.windows.windows; import core.sys.windows.shlobj; import core.sys.windows.wtypes; import std.exception; pragma(lib, "Ole32"); void main() { OleInitialize(null); scope(exit) OleUninitialize(); IShellFolder desktop; LPITEMIDLIST

Re: how to run 'dub upgrade' from within VisualD?

2020-09-08 Thread mw via Digitalmars-d-learn
On Monday, 24 August 2020 at 21:19:14 UTC, mw wrote: Hi, Just wonder how to run 'dub upgrade' from within VisualD? on Windows of course. As a work around, I just delete the proj.sln, and regenerated it: ``` C:\\ dub.exe generate visuald ``` then it have the latest package versions.

Re: Range checked assignment

2020-09-08 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 14:18:14 UTC, Cecil Ward wrote: I assumed I would have to create a struct type definition and handle various operators. How many will I have to handle? I would of course make it a template so I can reuse this otherwise horribly repetitive code. You can see a

Re: Range checked assignment

2020-09-08 Thread Harry Gillanders via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 14:18:14 UTC, Cecil Ward wrote: What I would like to do is (in pseudo-code) : declare_var my_var : int range 0..7; // i.e. 0 <= val <= 7; my_var = 6; // ok my_var = 8; // bang ! static assert fail or assert fail at runtime my_var = 6;

Re: Range checked assignment

2020-09-08 Thread Mitacha via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 14:18:14 UTC, Cecil Ward wrote: What I would like to do is (in pseudo-code) : declare_var my_var : int range 0..7; // i.e. 0 <= val <= 7; my_var = 6; // ok my_var = 8; // bang ! static assert fail or assert fail at runtime my_var = 6;

Range checked assignment

2020-09-08 Thread Cecil Ward via Digitalmars-d-learn
What I would like to do is (in pseudo-code) : declare_var my_var : int range 0..7; // i.e. 0 <= val <= 7; my_var = 6; // ok my_var = 8; // bang ! static assert fail or assert fail at runtime my_var = 6; my_var += 2; // bang ! value 8 is > 7 So every assignment is

Re: GC.LDC2 on Android

2020-09-08 Thread Danny Arends via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 13:20:24 UTC, kinke wrote: On Tuesday, 8 September 2020 at 12:47:11 UTC, Danny Arends wrote: How can I figure out which linker is used ? When performing a dub build, it just mentions that ldc2 is used for linking You can add -v as dub 'linker' flag, that will

Re: GC.LDC2 on Android

2020-09-08 Thread Danny Arends via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 12:53:43 UTC, Adam D. Ruppe wrote: On Tuesday, 8 September 2020 at 12:47:11 UTC, Danny Arends wrote: How can I figure out which linker is used ? When performing a dub build, it just mentions that ldc2 is used for linking If you are using the d_android setup

Re: Named parameters in function call

2020-09-08 Thread Cecil Ward via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 09:40:11 UTC, Andre Pany wrote: On Tuesday, 8 September 2020 at 07:43:05 UTC, Cecil Ward wrote: I can’t remember, do Ada or Modula2 have something like myfunc( x => 100, y => 200, color => blue )[1] which has named parameters that can be passed in

Re: GC.LDC2 on Android

2020-09-08 Thread kinke via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 12:47:11 UTC, Danny Arends wrote: How can I figure out which linker is used ? When performing a dub build, it just mentions that ldc2 is used for linking You can add -v as dub 'linker' flag, that will make LDC show the actual cmdline. LDC v1.23 defaults to

Re: GC.LDC2 on Android

2020-09-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 12:47:11 UTC, Danny Arends wrote: How can I figure out which linker is used ? When performing a dub build, it just mentions that ldc2 is used for linking If you are using the d_android setup thing, it actually edits ldc2.conf so it uses the linker from the NDK.

Re: GC.LDC2 on Android

2020-09-08 Thread Danny Arends via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 12:23:43 UTC, kinke wrote: On Tuesday, 8 September 2020 at 11:17:45 UTC, Danny Arends wrote: Does anyone have any experience with using D on android, and using the garbage collector ??? I've never run anything on Android myself, but I've gotten good feedback

Re: GC.LDC2 on Android

2020-09-08 Thread kinke via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 11:17:45 UTC, Danny Arends wrote: Does anyone have any experience with using D on android, and using the garbage collector ??? I've never run anything on Android myself, but I've gotten good feedback on AArch64 at least. Make sure to use a recent LDC, and

GC.LDC2 on Android

2020-09-08 Thread Danny Arends via Digitalmars-d-learn
Hey all, I'm porting my 3D engine to Android (so far most of the work is going smoothly). However, I had random crashes which I first suspected was due to how I do multi-threading, but after debugging it turns out that the Garbage Collector is the issue. The crash always happens after

Re: Named parameters in function call

2020-09-08 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 8 September 2020 at 07:43:05 UTC, Cecil Ward wrote: I can’t remember, do Ada or Modula2 have something like myfunc( x => 100, y => 200, color => blue )[1] which has named parameters that can be passed in any order. [...] I hope we have it this year or next year, as we

Re: Install multiple executables with DUB

2020-09-08 Thread glis-glis via Digitalmars-d-learn
Thanks everybody! My folder structure looks like this: . ├── bin ├── dub.sdl ├── src │   ├── biophysics │ │ └── ... │   └── tools │ │ └── ... └── test ├── ... Following the advice of drug, I moved the "tools" folder from src to the parent directory, added a dependency to

Named parameters in function call

2020-09-08 Thread Cecil Ward via Digitalmars-d-learn
I can’t remember, do Ada or Modula2 have something like myfunc( x => 100, y => 200, color => blue )[1] which has named parameters that can be passed in any order. Does D have anything like this? If not, would anyone support a development like the above [1] ? If D does not have