On Sunday, 2 June 2024 at 21:46:41 UTC, solidstate1991 wrote:
Well, it turns out I used the windres found in mingw instead of
`rc.exe` since the latter cannot be found anywhere on my PC,
even after reinstalling stuff. I need to hunt it down somehow.
rc.exe comes with the Windows SDK - it gets
On Saturday, 25 May 2024 at 13:13:08 UTC, solidstate1991 wrote:
No, I meant something like this:
https://learn.microsoft.com/en-us/windows/win32/controls/cookbook-overview
Not tested but from memory I do this:
1) Copy that first XML snippet from the page you linked, save to
a file called
On Thursday, 20 April 2023 at 19:41:21 UTC, Joel wrote:
// how do I get the total of ages added together?
p.map!(x => x.age).sum();
On Wednesday, 12 April 2023 at 20:36:59 UTC, H. S. Teoh wrote:
---snip---
extern(C) void* abc(void*) {return null;}
alias FuncPtr = typeof();
You can also express it like this:
```d
extern(C) alias FuncPtr = void* function(void*);
```
On Thursday, 9 February 2023 at 19:17:55 UTC, Ali Çehreli wrote:
I could not figure out eliminating the hard-coded 4. Can we
introspect the parameter list of a template like 'fun' in the
example? If we could, then we could get 4 that way.
Thank you for this. I don't mind hard-coding the N
On Monday, 6 February 2023 at 09:17:07 UTC, Ali Çehreli wrote:
I adapted staticMap's implementation to two sets of arguments:
So I've got this implementation, but wonder if I can generalise
the arg splitting portion rather than write it manually for each
N?
```d
template staticMapN(size_t
On Monday, 6 February 2023 at 09:17:07 UTC, Ali Çehreli wrote:
I adapted staticMap's implementation to two sets of arguments:
Thanks Ali, that's perfect. I thought of splitting the args in
half a few hours later but hadn't got around to trying it.
I have two AliasSeqs: one containing a function's parameters
(SourceSeq), the other containing the types I want to convert
said parameters to (TargetSeq). I'd use something like staticMap
to call the conversion function with both a parameter from
SourceSeq and a type from TargetSeq, and return
On Friday, 13 January 2023 at 14:32:44 UTC, Salih Dincer wrote:
Why not directly use the mixin template for opDispatch()?
My opDispatch generates code based on the arguments passed,
interpolating variable names and functions based on the type. I
wanted to remove the double braces in my
I'm obviously doing something wrong, but don't quite understand.
```d
mixin template helper() {
mixin("writeln(12);");
}
struct Foo {
void opDispatch(string name)() {
import std.stdio;
mixin helper!();
//mixin("writeln(12);");
}
}
void main() {
Foo.init.opDispatch!"bar"();
On Friday, 9 September 2022 at 00:16:01 UTC, Injeckt wrote:
I need to add this struct definition in my project. But how to
do that?
This structure:
https://docs.microsoft.com/en-us/windows/win32/api/iptypes/ns-iptypes-ip_adapter_info
It's defined in DRuntime, so you can just import the module
On Thursday, 15 October 2020 at 20:13:37 UTC, Atmosfear wrote:
On Thursday, 15 October 2020 at 16:32:06 UTC, Imperatorn wrote:
On Thursday, 15 October 2020 at 12:45:42 UTC, Atmosfear wrote:
I didn't find how to call the queryperformancecounter
function. I tried this. Returns errors, doesn't
On Friday, 25 September 2020 at 15:03:56 UTC, Marcone wrote:
I need windowsx.d but for I don't know the reason is not in
dmd. Someone that have it can send to me? I don't know convert
windowsx.h to windowsx.d
windowsx.h is mostly a bunch of macros that forward to functions
elsewhere in the
On Thursday, 10 September 2020 at 13:30:15 UTC, FreeSlave wrote:
Thanks. I tried this, but VarDateFromStr does not succeed for
me.
It turns out the shell embeds some control characters in the
string, specifically 8206 and 8207. So remove those before
passing it to VarDateFromStr.
auto temp
On Wednesday, 9 September 2020 at 22:44:50 UTC, FreeSlave wrote:
Btw do you know how to parse a date returned by GetDetailsOf?
Couldn't find any examples in C++. I actually can see digits
representing date and time as a part of the string, but I would
prefer to use some winapi function to
On Tuesday, 8 September 2020 at 22:24:22 UTC, FreeSlave wrote:
However if I change the type of recycleBin variable to
IShellFolder (not IShellFolder2), the crash does not happen.
Does IShellFolder2 require some special handling?
The issue is caused by druntime's definition of IShellFolder2.
On Saturday, 13 June 2020 at 15:33:55 UTC, Boris Carvajal wrote:
On Saturday, 13 June 2020 at 09:02:21 UTC, John Chapman wrote:
Is this a bug or have I made a mistake? This worked a few days
ago and I haven't changed my setup since then.
https://issues.dlang.org/show_bug.cgi?id=19548
Your
If I use a final switch and import std.uni (or any other module
that imports it, such as std.string), I'm getting unresolved
external symbol errors with DMD 2.092.
This code triggers the issue:
---
module test;
import std.uni;
enum Cheese { cheddar, edam }
void test(Cheese cheese) {
On Tuesday, 26 May 2020 at 13:37:22 UTC, Vinod K Chandran wrote:
On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote:
On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote:
Here is my full code. Please take a look.
https://pastebin.com/av3nrvtT
Change line 124 to:
On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote:
Here is my full code. Please take a look.
https://pastebin.com/av3nrvtT
Change line 124 to:
SetWindowSubclass(this.mHandle, SUBCLASSPROC(),
UINT_PTR(subClsID), cast(DWORD_PTR)cast(void*)this);
That is, change `` to
Is it possible to overload a function template for rectangular
arrays? Is there any way to tell them apart from normal ones?
void foo(T)(T[] a) {}
void foo(T)(T[][] a) {}
auto ra = new int[][](5, 5);
ra.foo(); // matches both
Thanks for any hints.
On Thursday, 14 May 2020 at 09:49:15 UTC, wjoe wrote:
Is there an easy way to print an int in hexadecimal, octal or
binary representation ?
The documentation on pragma(msg, ...) and a quick web search
didn't provide an answer.
import std.string;
pragma(msg, format("%x", 10));
%x = hex
On Saturday, 11 January 2020 at 10:34:34 UTC, Marcone wrote:
This code works, but I can't get file Path. Someone can help me?
import std;
import core.sys.windows.windows;
pragma(lib, "comdlg32");
void main(){
OPENFILENAME ofn;
wchar* szFileName;
You need to supply a buffer, not a
On Wednesday, 6 November 2019 at 01:16:00 UTC, Manu wrote:
On Tue, Nov 5, 2019 at 5:14 PM Manu wrote:
On Tue, Nov 5, 2019 at 1:20 PM John Chapman via
Digitalmars-d-announce
wrote:
>
> On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
> > Incidentally, in your
On Tuesday, 5 November 2019 at 19:05:10 UTC, Manu wrote:
Incidentally, in your sample above there, `a` and `b` are not
shared... why not just write: `cas(, null, b);` ?? If source
data is not shared, you shouldn't cast to shared.
Because casts were needed in 2.088 and earlier and I just
On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote:
Sure - this AVs on DMD 2.088 Windows:
import core.atomic;
void main() {
Object a, b = new Object;
cas(cast(shared), null, cast(shared)b);
}
Sorry, I meant it AVs 2.089, but works on 2.088.
On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote:
On Mon., 4 Nov. 2019, 2:05 am John Chapman via
Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com>
wrote:
Something has changed with core.atomic.cas - it used to work
with `null` as the `ifThis` argument, now it
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote:
Glad to announce D 2.089.0, ♥ to the 44 contributors.
This release comes with corrected extern(C) mangling in mixin
templates, atomicFetchAdd and atomicFetchSub in core.atomic,
support for link driver arguments, better support of
On Sunday, 20 October 2019 at 21:45:35 UTC, Robert M. Münch wrote:
class myWidget : Observer!message {...}
class FilterSubject : SubjectObject!message {
Disposable subscribe(myWidget observer){...}
}
I tried to add "alias subscribe = SubjectObject.subscribe;" in
different places, but that
On Sunday, 27 January 2019 at 16:23:42 UTC, FrankLike wrote:
On Sunday, 27 January 2019 at 10:44:04 UTC, John Chapman wrote:
On Sunday, 27 January 2019 at 06:14:15 UTC, FrankLike wrote:
On Saturday, 26 January 2019 at 09:33:33 UTC, John Chapman
wrote:
What has that code got to do with
On Sunday, 27 January 2019 at 06:14:15 UTC, FrankLike wrote:
On Saturday, 26 January 2019 at 09:33:33 UTC, John Chapman
wrote:
What has that code got to do with setting the console's font?
So you need to add more code to accomplish that.
You don't need to set the font to achieve the goal,
On Saturday, 26 January 2019 at 06:03:25 UTC, FrankLike wrote:
On Friday, 25 January 2019 at 15:05:50 UTC, John Chapman wrote:
On Friday, 25 January 2019 at 14:23:15 UTC, FrankLike wrote:
I need to set the font by the code now, because I need to do
the installer, can't let this installer set
On Friday, 25 January 2019 at 14:23:15 UTC, FrankLike wrote:
I need to set the font by the code now, because I need to do
the installer, can't let this installer set the properties on
each computer?
SetCurrentConsoleFontEx perhaps?
On Tuesday, 11 December 2018 at 08:20:32 UTC, Arun Chandrasekaran
wrote:
A typical example would be to split the HTTP query string into
an AA.
vibe.d has req.queryString, but no convenient wrapper to access
it as an AA.
http://localhost/hello?name=abc=123
I've got this far.
auto
On Saturday, 8 December 2018 at 13:02:00 UTC, Yuxuan Shui wrote:
This surprised me A LOT:
https://d.godbolt.org/z/82a_GZ
So if I call something.map!().array, I get an array of
delegates? That makes no sense to me.
But in your example, "(a) =>" returns "{return tmp;}", which is a
delegate.
I get an "ambiguous virtual function" error when I compile this:
interface I {
void fun();
}
mixin template F() {
void fun() {}
}
class C : I {
mixin F;
mixin F;
}
But the error doesn't occur with this:
class C : I {
mixin F;
void fun() {}
}
Is the
On Thursday, 29 November 2018 at 21:31:57 UTC, Neia Neutuladh
wrote:
On Thu, 29 Nov 2018 21:11:06 +, John Chapman wrote:
Is there any way to get a string representing a function's
exact signature as declared in the source? I can generate it
myself using reflection but it might not be 100%
Is there any way to get a string representing a function's exact
signature as declared in the source? I can generate it myself
using reflection but it might not be 100% verbatim so wanted to
know if there's anything built in?
foreach (m; __traits(allMembers, T)) {
alias member =
On Thursday, 29 November 2018 at 13:42:28 UTC, greatsam4sure
wrote:
Which class in dlangui is use to obtain the screen height and
width?
A Windom of dimension 280 x 445 in dlangui is the same as a
Windom of 350 x 550 in Javafx and adobe air.
What could be responsible for this wide difference?
On Friday, 23 November 2018 at 21:49:55 UTC, Kagamin wrote:
Well, just have all factories in one module and import it, then
they will be visible.
They're part of another library over which I have no control, but
yes, I could still import them all and make life easier.
import allfactories;
On Friday, 23 November 2018 at 11:29:24 UTC, Nicholas Wilson
wrote:
No, std.functional.memoize uses a hashtable to cache the
runtime results of calls to expensive functions.
assuming that the example is not oversimplified and
generateFunc1 and generateFunc2 are functions, the compiler
I'm doing a fair amount of repeatedly checking if a function
compiles with __traits(compiles...), executing the function if
so, erroring out if not, like this:
static if (__traits(compiles, generateFunc1())) {
return generateFunc1();
} static if (__traits(compiles, generateFunc2())) {
On Thursday, 22 November 2018 at 16:27:08 UTC, Eduard Staniloiu
wrote:
So I had a go at this and I have a working solution.
https://run.dlang.io/is/oaH6Ib
At first, I tried to do everything in the mixin, as you can see
with the `failedAttempt` function. The idea was that this
should have
On Monday, 19 November 2018 at 16:29:01 UTC, helxi wrote:
On Monday, 19 November 2018 at 16:10:15 UTC, helxi wrote:
...
Oh wait never mind I was missing a bracket:
auto proc = task!(ddCall.dd());
Now I have another thing to worry about: ddcall.dd() cannot be
read at compile
On Saturday, 17 November 2018 at 21:11:38 UTC, Adam D. Ruppe
wrote:
On Saturday, 17 November 2018 at 17:58:54 UTC, John Chapman
wrote:
Has anyone had a similar need and come up with a solution?
You might be able to just pass it the Calendar type, and then
fetch its parent module and get the
The following code doesn't compile because the generated type
name needs to be available inside the mixin's scope, whereas it's
actually in another module.
auto makeWith(string className, Args…)(auto ref Args args) {
mixin("return makeWith!(I", className, "Factory)(args);"); //
Fowarded to
On Thursday, 8 November 2018 at 20:19:47 UTC, Vladimir Panteleev
wrote:
On Thursday, 8 November 2018 at 19:07:32 UTC, Jacob Carlborg
wrote:
21 seconds on a Windows 10 virtual machine compiling using the
win32.mak file.
Sounds like we're narrowing it down to the Visual Studio
solution.
On Sunday, 4 November 2018 at 19:06:22 UTC, Mark Moorhen wrote:
Another Windows challenge:
I'm trying to get the title of the active window even if it is
from an external application. This is what I've come up with so
far:
import std.stdio;
import core.sys.windows.windows;
extern
On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote:
Any reason why this works?
https://run.dlang.io/is/TALlyw
"private" applies to the module, not the type.
https://dlang.org/spec/attribute.html#visibility_attributes
On Monday, 1 October 2018 at 20:27:43 UTC, spikespaz wrote:
Of course there is nothing wrong with defining each callback as
a separate function, but then comes the issue of naming them. I
also don't like the way it makes my code look.
I think the best you can do is something like this:
---
On Saturday, 17 March 2018 at 17:16:40 UTC, David Nadlinger wrote:
On Friday, 16 March 2018 at 07:57:04 UTC, John Chapman wrote:
I need to write to a range created with outputRangeObject,
then read from it. Is there a way to convert it to an input
range?
Could you illustrate your problem a
I need to write to a range created with outputRangeObject, then
read from it. Is there a way to convert it to an input range?
On Wednesday, 31 January 2018 at 11:52:20 UTC, rumbu wrote:
On Windows platform, WPF is the way to go right now. Once you
accommodate yourself with XAML (descriptive language for
designing windows and controls), you can step up from WPF to
modern Windows apps (UWP). Unfortunately, none of
On Tuesday, 2 January 2018 at 12:19:19 UTC, David Nadlinger wrote:
There is indeed no way to do this; as you say, aliases are just
names for a particular reference to a symbol. Perhaps you don't
actually need the names in your use case, though?
— David
The idea was to distinguish between a
Because an alias of a type is just another name for the same
thing you can't test if they're different. I wondered if there
was a way to get the aliased name, perhaps via traits? (.stringof
returns the original type.)
I can't use Typedef because I'm inspecting types from sources I
don't
On Sunday, 31 December 2017 at 18:21:29 UTC, Domain wrote:
In Windows, exists, rename, copy will report file not exists
when you input non-English filename, such as Chinese 中文.txt
Works for me. I created a file with the name "中文.txt" and
std.file.exists returned true.
Is your D source file
On Saturday, 30 December 2017 at 10:14:35 UTC, tipdbmp wrote:
// how can I adjust _argptr?
_argptr = ???
Try this:
_argptr = *cast(va_list*)_argptr;
On Tuesday, 5 December 2017 at 19:01:48 UTC, A Guy With a
Question wrote:
The following doesn't appear to be valid syntax. Array!Item!T
I get the following error:
"multiple ! arguments are not allowed"
Which is ok...I get THAT error, however, this does not work
either:
alias
On Saturday, 25 November 2017 at 15:38:15 UTC, Adam D. Ruppe
wrote:
nope. It'd be indistinguishable from the user just happening to
initialize it to some random value.
Thanks. I'll got with .init instead.
Is there any way of determining whether a variable has been
initialized or not? For example, if something is declared like
this:
int x = void;
can I check if it's void before I use it, say, in a function it's
been passed to?
On Thursday, 13 July 2017 at 01:15:46 UTC, FoxyBrown wrote:
ENUM_SERVICE_STATUS_PROCESS[5000] services;
auto res = SVC.EnumServicesStatusExA(schSCManager,
SC_ENUM_TYPE.SC_ENUM_PROCESS_INFO, servicesType,
SERVICE_STATE_ALL, cast(ubyte*)services.ptr,
On Sunday, 30 April 2017 at 16:05:10 UTC, Igor wrote:
On Sunday, 30 April 2017 at 15:53:07 UTC, Mike Parker wrote:
On Sunday, 30 April 2017 at 14:56:44 UTC, Igor wrote:
I tried updating sc.ini to new paths but I still get this
error. Can someone offer some advice?
Which paths did you set?
On Thursday, 27 April 2017 at 20:20:23 UTC, Nierjerson wrote:
I think the main issue though, is that I really don't know what
is going on when I invoke the PS function. It seems to call the
server method that takes the interface and then the server does
it's "magic"(which is calling my
On Wednesday, 26 April 2017 at 23:04:53 UTC, Nierjerson wrote:
On Wednesday, 26 April 2017 at 15:30:37 UTC, John Chapman wrote:
On Tuesday, 25 April 2017 at 18:39:56 UTC, Nierjerson wrote:
[...]
When you use DISPATCH_PROPERTYPUT you need to set cNamedArgs
and rgdispidNamedArgs like so:
On Tuesday, 25 April 2017 at 18:39:56 UTC, Nierjerson wrote:
void RGB(icRGBColor ic, cSolidColor s)
{
import main;
EXCEPINFO exception;
uint argErr = 0;
auto iidNULL = IID_NULL;
auto RT = new SafeVariantPtr();
VARIANT[1] paramVars;
DISPPARAMS
On Monday, 3 April 2017 at 21:49:07 UTC, Inquie wrote:
I am using opDispatch to wrap function calls
Error: 'this' is only defined in non-static member functions,
not opDispatch!"foo"
class X
{
auto localfoo() { return 3; }
template opDispatch(string name, Args...)
{
On Monday, 27 March 2017 at 21:02:05 UTC, Nierjerson wrote:
Anyone can help get this working? I think the issue maybe that
the interface pointer returned by the COM interface is "C-like"
and doesn't match what D expects an interface to be. I get
access violations when trying to call the
On Friday, 6 November 2015 at 15:52:10 UTC, johann wrote:
hi,
i like to use a window gui library and i think i found a
working one.
https://github.com/FrankLIKE/dfl2 - works with x64
the problem is, that with DMD 2.069.0, VS2015 and visualD the
trick of using "-L/SUBSYSTEM:windows,6.00
On Friday, 31 July 2015 at 22:02:13 UTC, Paul D Anderson wrote:
I'm waiting to upgrade from Windows 7 to Windows 10 to avoid
the inevitable just-released bugs, but does anyone have any
info about D on Windows 10? Has anyone tried it?
I'm on Windows 10, and my DMD-built programs run just fine.
On Saturday, 27 June 2015 at 17:43:13 UTC, aki wrote:
I want to print the contents of Array!int
import std.stdio;
import std.container;
void pr(Array!int a) {
foreach(i, v; a[]) {
writeln(%4s: %s\n, i, v);
}
}
But when I compile it by DMD 2.062 on Windows
it
On Wednesday, 24 June 2015 at 01:04:01 UTC, Adam D. Ruppe wrote:
The code breakage is minimal
Won't this break isSomeString? Phobos uses this everywhere.
On Monday, 22 June 2015 at 11:45:31 UTC, Wyatt wrote:
None of the suggestions I've seen so far really call out to me
hey, this is lazy and has a non-lazy counterpart. Would it
be so wrong to add lazy to the beginning or end so it's super
obvious at a glance with zero cognitive overhead?
On Wednesday, 17 June 2015 at 20:50:27 UTC, John Chapman wrote:
wchar[MAX_PATH] buffer;
int length = GetWindowTextW(GetForegroundWindow(),
buffer.ptr, buffer.length);
Don't know why I used MAX_PATH there. You should probably
dynamically allocate a buffer based on GetWindowTextLengthW.
On Wednesday, 17 June 2015 at 21:00:55 UTC, Dan wrote:
thank you John it worked :)
do I always need do the same for all windows API?
For most Win32 API functions, yes. Although there are some more
complete headers on Github (for example,
https://github.com/rikkimax/WindowsAPI).
On Wednesday, 17 June 2015 at 20:40:02 UTC, Dan wrote:
I'm new to Dlang and I have no Idea whats wrong with this code!
wchar[260] buffer;
HWND hWindow = GetForegroundWindow();
GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here
The compiler is complaining it can't find an
On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote:
On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote:
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote:
BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr);
That should be:
BOOL result = SHGetFolderPath(null, 0x23,
On Tuesday, 16 June 2015 at 12:42:16 UTC, C2D wrote:
On Tuesday, 16 June 2015 at 12:31:23 UTC, John Chapman wrote:
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote:
BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr);
That should be:
BOOL result = SHGetFolderPath(null, 0x23,
On Tuesday, 16 June 2015 at 12:26:45 UTC, C2D wrote:
BOOL result = SHGetFolderPath(null, 0x23, null, 0, cache.ptr);
That should be:
BOOL result = SHGetFolderPath(null, 0x23, null, 0, buf.ptr);
On Wednesday, 10 June 2015 at 09:30:37 UTC, Robert burner Schadek
wrote:
On Wednesday, 10 June 2015 at 09:12:17 UTC, John Chapman wrote:
Logging
std.experimental.logger!?
Perfect, he said sheepishly.
It's a shame ucent/cent never got implemented. But couldn't they
be added to Phobos? I often need a 128-bit type with better
precision than float and double.
On Wednesday, 10 June 2015 at 07:56:46 UTC, John Chapman wrote:
It's a shame ucent/cent never got implemented. But couldn't
they be added to Phobos? I often need a 128-bit type with
better precision than float and double.
Other things I often have a need for:
Weak references
Queues, stacks,
On Wednesday, 13 May 2015 at 20:09:44 UTC, wobbles wrote:
On windows,
core.thread.Sleep (big 'S')
On linux
core.thread.sleep (little 'S')
I'm trying to import as little symbols as possible, so was
importing specific items like
import core.thread : Sleep;
but it fails when I compile on
On Sunday, 1 February 2015 at 08:37:23 UTC, ketmar wrote:
seems that my idea of using D to write a simple windows utility
was very
wrong. ok, another attempt to use D for our windows
developement has
failed. i'm in no way can sell manual .def creation to our
team -- they
will make fun of me,
Looks like the documentation for DMD's command line switches and
platform-specific information has disappeared from the site. It
used to live under Downloads Tools in menus labelled Linux
notes, Windows notes etc.
there is no HMAC-SHA1 algorithm in phobos library... should I
implement it from scratch?
http://dlang.org/phobos/std_digest_sha.html#SHA1
On Thursday, 12 June 2014 at 05:39:06 UTC, Karen Bantoft wrote:
I'm looking for the John Chapman who worked as a programmer at
Centre-file Ltd, in Finsbury Circus London in 1971.
Any leads?
Karen
Not me, sorry.
Importing both core.thread and std.regex results in a conflict as
both define a Thread type.
Perhaps the regex module's author assumed there'd be no clash
since it's a template - Thread(DataIndex). Should I file a bug
suggesting a name change? Or maybe D ought to allow both
parameterised and
87 matches
Mail list logo