i have that.
with GCD. ;-)
signature.asc
Description: PGP signature
I want to write a function template that works for any array of a
particular type, but not the base type, so real[], real[][], etc,
but not real. I was using ForeachType to do some testing, but it
doesn't really get the base type. It just takes one of the [] off
and returns the remaining type
Hi.
Any thoughts on the best way to write D functions that I can call
from Excel? I am completely unfamiliar with Windows programming
and COM (last time I wrote this kind of thing was in the mid-90s
I think using xloper and C).
The easiest way for now seems to be via pyxll and pyd. Wrap
On Wednesday, 17 June 2015 at 19:53:07 UTC, jmh530 wrote:
I want to write a function template that works for any array of
a particular type, but not the base type, so real[], real[][],
etc, but not real. I was using ForeachType to do some testing,
but it doesn't really get the base type. It
On Wed, 17 Jun 2015 06:02:46 +, WhatMeWorry wrote:
I guess the question would be why would one want a struct on the heap
and a class on the stack? Performance reasons?
struct on the heap: some containers, for example, doing their own memory
management.
class on the stack: guaranteed
On Wednesday, 17 June 2015 at 20:06:54 UTC, Alex Parrill wrote:
Try:
void foo(T)(T[] arg) {
// In here, T should be the element type, and T[] the array
type.
}
Not a general solution, but you mentioned that you wanted this
for a function parameter.
I don't think this works for
thank you John it worked :)
do I always need do the same for all windows API?
thank you so much John :)
On Wednesday, 17 June 2015 at 20:33:11 UTC, Namespace wrote:
import std.stdio;
template BaseTypeOf(T) {
static if (is(T : U[], U))
alias BaseTypeOf = BaseTypeOf!(U);
else
alias BaseTypeOf = T;
}
void foo(T : U[], U)(T arr) if (is(BaseTypeOf!(U) == real)) {
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 Wed, 17 Jun 2015 09:49:56 +0900, Mike Parker wrote:
On 6/17/2015 6:17 AM, tcak wrote:
As far as I known, when I define a string with enum and it is used at
different parts of code, that string is repeated again and again in
executable file instead of passing a pointer to string. So, using
On Wednesday, 17 June 2015 at 20:58:10 UTC, jmh530 wrote:
On Wednesday, 17 June 2015 at 20:33:11 UTC, Namespace wrote:
import std.stdio;
template BaseTypeOf(T) {
static if (is(T : U[], U))
alias BaseTypeOf = BaseTypeOf!(U);
else
alias BaseTypeOf = T;
}
void foo(T
import std.stdio;
template BaseTypeOf(T) {
static if (is(T : U[], U))
alias BaseTypeOf = BaseTypeOf!(U);
else
alias BaseTypeOf = T;
}
void foo(T : U[], U)(T arr) if (is(BaseTypeOf!(U) == real)) {
}
void main() {
//real _x;
real[2] x;
On Wednesday, 17 June 2015 at 20:20:29 UTC, jmh530 wrote:
On Wednesday, 17 June 2015 at 20:06:54 UTC, Alex Parrill wrote:
Try:
void foo(T)(T[] arg) {
// In here, T should be the element type, and T[] the
array type.
}
Not a general solution, but you mentioned that you wanted this
for
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 19:53:07 UTC, jmh530 wrote:
I want to write a function template that works for any array of
a particular type, but not the base type, so real[], real[][],
etc, but not real. I was using ForeachType to do some testing,
but it doesn't really get the base type. It
hi
I'm using those imports:
import core.runtime;
import core.sys.windows.windows;
when I call GetWindowTextW DMD compiler complains!
(error:undefined identifier)
any solution?
GetWindowTextW(hWindow, buffer, sizeof(title)); -- Problem here
please Ignore the sizeof(title) parameter, I copied that from c++
equivalent code :D
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
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 Wednesday, 17 June 2015 at 11:07:29 UTC, weaselcat wrote:
On Wednesday, 17 June 2015 at 07:53:16 UTC, Atila Neves wrote:
I thought it was because I was weird and I use gold as my
linker, but ld.bfd produced the same results. The most I could
find in bug reports was someone complaining it
On Wednesday, 17 June 2015 at 07:53:16 UTC, Atila Neves wrote:
I thought it was because I was weird and I use gold as my
linker, but ld.bfd produced the same results. The most I could
find in bug reports was someone complaining it used to work but
the consensus was that it never did?
Atila
On Tuesday, 16 June 2015 at 12:41:14 UTC, Daniel Kozák wrote:
mixin template include(w...)
{
mixin _include!(w.length - 1, w);
}
mixin template _include(long N, i...)
{
mixin(import ~ i[N] ~ ;);
mixin _include!(N - 1, i);
}
mixin template _include(long N : 0, i...)
{
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,
I thought it was because I was weird and I use gold as my linker,
but ld.bfd produced the same results. The most I could find in
bug reports was someone complaining it used to work but the
consensus was that it never did?
Atila
On Tuesday, 16 June 2015 at 17:32:33 UTC, CallToDuty wrote:
On Tuesday, 16 June 2015 at 16:57:52 UTC, John Colvin wrote:
On Tuesday, 16 June 2015 at 16:42:31 UTC, CallToDuty wrote:
Is it possible to embed a dll file within dub project? and if
yes, how?
Have you tried just putting it in the
On Monday, 8 June 2015 at 04:08:55 UTC, Adam D. Ruppe wrote:
The easiest way is to not use search paths, and instead pass
all the modules you want compiled to the compiler directly.
Then it will look for the module name declaration instead of
the directory/filename layout.
I think that this
druntime has never had support for file/line info in traces on
Linux AFAIR
gdb usually saves the day
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 Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I don't see a way how I
could access (cast) the raw data of a
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with static
and dynamic build in arrays, but I don't see a way how I could
access (cast) the raw data of a std.container.array to forward it
to these wrapper functions.
On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I don't see a way how I
could access (cast) the raw data of a
On Wednesday, 17 June 2015 at 13:07:11 UTC, Alex Parrill wrote:
On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I
On Wednesday, 17 June 2015 at 13:31:21 UTC, Marc Schütz wrote:
On Wednesday, 17 June 2015 at 13:04:28 UTC, ParticlePeter wrote:
I use wrapper functions taking void[] arrays to forward them
comfortably to mentioned OpenGL functions. This works with
static and dynamic build in arrays, but I
On Wednesday, 17 June 2015 at 13:58:09 UTC, Kagamin wrote:
(arr.front())[0 .. arr.length] ?
Yes, this works, nice, thanks :-)
(arr.front())[0 .. arr.length] ?
On Sunday, 14 June 2015 at 01:31:25 UTC, Adam D. Ruppe wrote:
On Sunday, 14 June 2015 at 00:52:20 UTC, FujiBar wrote:
I have read that in D structs are always allocated on the
stack while classes are always allocated on the heap.
That's not true; it is a really common misconception.
Putting
37 matches
Mail list logo