On Wednesday, 21 December 2016 at 11:45:18 UTC, Eugene Wissner
wrote:
This prints 3 times "Destruct" with dmd 0.072.1. If I remove
the if block, it prints "Destruct" only 2 times - the behavior
I'm expecting. Why?
Possibly to do with named return value optimisation.
On Sunday, 4 December 2016 at 06:51:24 UTC, Tofu Ninja wrote:
So what is the proper way to get the hash of something now?
This question came up a few days ago:
http://forum.dlang.org/post/o1igoc$21ma$1...@digitalmars.com
Some DirectX methods return structs by value, but when I try
calling them I either get garbage or an access violation.
Usually COM methods return structs by pointer as a parameter, but
these are returning the struct as the actual return value, as in
this definition:
extern(Windows):
stru
On Friday, 11 November 2016 at 20:55:52 UTC, Charles Hixson wrote:
Thank you. Unfortunately:
importstd.math;
...
assert(isNan (c.curActivation), "cell has unexpected
curActivation: %s".format(c.curActivation));
yields:
cell.d(292): Error: undefined identifier 'isNan', did
On Saturday, 5 November 2016 at 21:02:14 UTC, Adam D. Ruppe wrote:
coff2omf works with .obj files
Well, that's not what the docs say!
http://www.digitalmars.com/ctg/coff2omf.html
"The input files can be either object files (.obj) or library
files (.lib)"
Apparently you have to convert t
On Saturday, 5 November 2016 at 16:13:18 UTC, Sarcross wrote:
If you're wondering, I did use the COFF2OMF tool on the library
I got from the C# code, which is why in WordFileParser.d you'll
see "pragma(lib, "Parser2")".
I have never had success trying to link with a lib file converted
by COFF
On Monday, 24 October 2016 at 05:43:00 UTC, Andre Pany wrote:
Hi,
I try to get sqlite3.lib for 64 Bit windows os.
I tried implib with the def file and the 64 Bit dll:
implib sqlite3_implib.lib sqlite3.def /system
-> App crash (Windows 10)
With the dll file defined:
implib sqlite3_implib.lib sq
On Monday, 10 October 2016 at 14:14:08 UTC, Cleverson Casarin
Uliana wrote:
Hello, when I run a compiled Windows executable at the console,
letters outside the ascii range such as ç and ã do not display
propperly. Is there any d function to change the console code
page on the fly? My Windows co
On Saturday, 8 October 2016 at 13:35:57 UTC, Cleverson Casarin
Uliana wrote:
Thank you Vadim and John, the PlaySound function is enough for
now. I'm not yet developing an app, just experimenting with
some exercises.
The wasapi library seems interesting, does it also implement a
playSound-like
On Saturday, 8 October 2016 at 01:00:20 UTC, Cleverson Casarin
Uliana wrote:
Hello all, starting to learn d, apreciating it so far. I'd like
to play/stop wave sound files assynchronously on Windows. Can I
get a module for that by installing a particular compiler, or
is there any package for it
On Wednesday, 5 October 2016 at 11:46:14 UTC, Adam D. Ruppe wrote:
On Wednesday, 5 October 2016 at 11:43:12 UTC, John C wrote:
Is there a way to convert something like AliasSeq!(int, int,
int) to an int[] - the opposite of aliasSeqOf?
If it is a legal array (matching types), just put
Is there a way to convert something like AliasSeq!(int, int, int)
to an int[] - the opposite of aliasSeqOf?
On Friday, 23 September 2016 at 18:20:24 UTC, Martin Nowak wrote:
Please file a bug report issues.dlang.org, shouldn't be
difficult to fix.
Done: https://issues.dlang.org/show_bug.cgi?id=16531
If I try to call the protected method of a superclass from inside
the body of a delegate, the compiler won't allow it.
void layoutTransaction(Control c, void delegate() action) {
// do stuff
action();
// do more stuff
}
class Control {
protected void onTextChanged() {}
}
class Label :
div0 Wrote:
> >
> While we're on the subject, is it possible to mixin in a tuple?
> Doesn't seem like you can...
>
> class C(M...) {
> mixin M;
> }
>
> Doesn't work.
import std.typetuple;
class C(M...) {
mixin TypeTuple!(M);
}
Sam Hu wrote:
From std.range:
enum StoppingPolicy
{
/// Stop when the shortest range is exhausted
shortest,
/// Stop when the longest range is exhausted
longest,
/// Require that all ranges are equal
requireSameLength,
}
From std.thread:( phobos webpage)
enum State;
A f
Sam Hu wrote:
John C Wrote:
Sam Hu Wrote:
John C Wrote:
Ivan Boritsky wrote:
i work on a win32 application. i try to access my web camera.
when i use this api funtion;
capCreateCaptureWindow("cam", WS_VISIBLE + WS_CHILD, 10, 10,266, 252, hWnd, 0);
That should be: WS_VISIBLE
Sam Hu Wrote:
> John C Wrote:
>
> > Ivan Boritsky wrote:
> > > i work on a win32 application. i try to access my web camera.
> > > when i use this api funtion;
> > > capCreateCaptureWindow("cam", WS_VISIBLE + WS_CHILD, 10, 10,266, 252,
&g
Ivan Boritsky wrote:
i work on a win32 application. i try to access my web camera.
when i use this api funtion;
capCreateCaptureWindow("cam", WS_VISIBLE + WS_CHILD, 10, 10,266, 252, hWnd, 0);
That should be: WS_VISIBLE | WS_CHILD.
i get this error:
Error: undefined identifier capCreateCaptur
Sam Hu Wrote:
> Stewart Gordon Wrote:
>
> >
> > Read the source of std.date and see for yourself. If it's getting it
> > wrong, it suggests either your system is misconfigured or you're using
> > it wrongly. But since you still haven't posted your code, I still can't
> > comment further.
>
John Cahn Wrote:
> anyone know how to delete/remove a file with tango. thanks in advance.
http://www.dsource.org/projects/tango/wiki/ChapterIoFileSystem
Sam Hu Wrote:
> John C Wrote:
>
> > Object.factory requires a fully qualified class name, so if class Dog
> > resides in module animals, call Object.factory("animals.Dog").
>
> It works now.Great!Thanks so much!
>
> But...may I ask how do you know that
Sam Hu Wrote:
>
> In below code snippet:
>
> class Dog
> {
> public void bark(){}
> }
> int main(string[] args)
> {
> auto obj=Object.factory("Dog");
> Dog doggie=cast(Dog)obj;
> doggie.bark;
>
> return 0;
> }
>
> Compiled successfully but failed when run:
> Object.Error:Access Violation.
>
>
unknown Wrote:
> Hi,
>
> Given the example below:
> string str = "1 2 3 4 5 6";
> double[] numbers = to!(double[])(split(str));
> writefln(to!string(numbers));
>
> I get [1, 2, 3, 4, 5, 6] which is okay.
>
> How do I output it with different separators?
>
> What I would like to get is [ 1 2 3
What strategies do library authors have for maintaining two versions of a their
code - one for D 1.0 and another for 2.0? When they make changes to one
version, do they manually copy them into the other branch? Or is there a way of
automating the process?
Version blocks don't seem to help much.
Sam Hu Wrote:
> Thanks.The construct is clear now.
>
> Still leaves Q1,that is ,the *if* expression after the template definition,I
> want to learn more about the usage,where can I find more information?
It is in the spec: http://www.digitalmars.com/d/2.0/template.html#Constraint
Saaa Wrote:
> >
> > import std.stdarg;
> >
> > assert( _arguments[0] is typeid(int*) );
> > auto arg = va_arg!(int*)(_argptr);
> > *arg = 10;
> >
> > Probably.
> >
> > -- Daniel
>
> Calling the following returns an Access Violation Error after
> correctly writing the two lines.
>
> void main()
Sam Hu Wrote:
> Hi Sivo & John,
>
> Thank you very much!!!The two versions all work.
>
> But I am a bit confused with the key word *in* in both versions.
It's simple, really. Strings are immutable in D2. And "in" is equivalent to
"immutable".
By the way, best to use wstring (for UTF-16) or st
Sam Hu Wrote:
> Hello,
>
> In D2 I tried to write a simple function which wrapps WIN32 API
> MessageBoxW,with which I can handle wide characters like Chinese .Below is my
> try:
>
> import std.string;
> import std.conv;
> import std.c.windows.windows;
>
> extern(Windows)int MessageBoxW(HWND,L
Tyro[a.c.edwards] Wrote:
> When I do this, how do I ensure that the program is able to locate the
> font after extraction without "installing" it?
>
I think AddFontResource from the SDK will do that.
http://msdn.microsoft.com/en-us/library/dd183326(VS.85).aspx
gabrielsylar Wrote:
> can anybody please tell me how to properly convert from void* to void[]
> as the code below?
>
> void[] get_bytes(int n) { return sqlite3_column_blob(stmt, n); }
return sqlite3_column_blob(stmt, n)[0 .. n];
BCS Wrote:
> I find my self in need of a line drawing package. I need to pop a window
> and draw lines and points. Text would be nice but I can live without it.
> Most importantly, I need something that is dirt simple to get running. I
> don't have time to dink around with libs (if I did have t
new Wrote:
> hi,
>
> how does one convert char[] to BSTR and back? i am looking to use a dll that
> contains function such as
>
> BSTR tester = gettest(BSTR *in, BSTR in1);
>
> any help is appreciated.
wchar* bstr = SysAllocString(std.utf.toUTF16z(s));
and
char[] s = std.utf.toUTF8(bstr
TSalm Wrote:
> Hello,
>
> I'm searching to have a generic comparator function.
>
> I done this :
>
> /* CODE */
> import tango.io.Stdout;
>
> /***
> * Not for arrays
> ***/
> int compare(T)(T o1,T o2)
> {
>static if ( is( T bar == class ) || is( T
novice2 Wrote:
> i am afraid that windows API named *W works with UCS2 string.
> but D wchar[] is UTF-16.
Wrong - Windows has used UTF-16 as native since Windows 2000.
35 matches
Mail list logo