Windows system casting

2016-06-06 Thread Alexander Patapoff via Digitalmars-d-learn
import std.stdio; import std.string; import core.sys.windows.windows; void main() { string filepath = "C:\\Users\\awpat\\Pictures\\patterns_00387591.jpg"; auto p = toStringz(filepath); int result; result = SystemParametersInfo(cast(uint)SPI_SETDESKWALLPAPER,

Re: Interfaces

2016-04-09 Thread alexander Patapoff via Digitalmars-d-learn
On Saturday, 9 April 2016 at 08:59:13 UTC, ag0aep6g wrote: On 09.04.2016 10:45, alexander Patapoff wrote: [...] There is a somewhat obscure feature which lets you declare and instantiate a class at the same time: interface Action { void actions(int x); } void main() { Action

Interfaces

2016-04-09 Thread alexander Patapoff via Digitalmars-d-learn
is there a way for me to do this in D? In java, one is able to create a new instance of an interface. interface Action { void actions(T t); } class testAction { this() { Action action = new Action() { void actions(T t){...} } } } I found this feature