Is there some Windows expert or someone you can tell me if I do
things wrong?
I can open the printer and also print but I'm failing to restore
the printer settings from a file.
```d
import core.sys.windows.windows;
import core.sys.windows.winspool;
import std;
pragma(lib, "winspool.lib");
e
I found https://dlang.org/library/std/typecons/unique.html ,
which I think solves my problem by disabling copying. Thanks for
the help.
Sorry for messed up post, fixed it.
On Wednesday, 6 October 2021 at 18:29:34 UTC, Steven
Schveighoffer wrote:
You can return this thing and pass it around, and the GC will
keep it alive until it's not needed. Then on collection, the
value is freed.
Is the gc required to call ~this() on the s
Thanks for the help.
On Wednesday, 6 October 2021 at 18:29:34 UTC, Steven
Schveighoffer wrote:
You can return this thing and pass it around, and the GC will
keep it alive until it's not needed. Then on collection, the
value is freed.
Is the gc required to call ~this() on the struct? I remember
On Wed, Oct 06, 2021 at 06:06:38PM +, anon via Digitalmars-d-learn wrote:
> I interface to a C library that gives me a malloced object. How can I manage
> that pointer so that it gets freed automatically.
> What I've thought of so far:
[...]
> * struct wrapped in automem/ refcounted: The struct
On 10/6/21 2:06 PM, anon wrote:
I interface to a C library that gives me a malloced object. How can I
manage that pointer so that it gets freed automatically.
What I've thought of so far:
* scope(exit): not an option because I want to return that memory
* struct wrapper: Doesn't work because if
I interface to a C library that gives me a malloced object. How
can I manage that pointer so that it gets freed automatically.
What I've thought of so far:
* scope(exit): not an option because I want to return that memory
* struct wrapper: Doesn't work because if I pass it to another
function, t