Re: how to get the local?

2011-06-01 Thread Andrew Wiley
On Thu, Jun 2, 2011 at 12:23 AM, Nick Sabalausky wrote: > "Andrej Mitrovic" wrote in message > news:mailman.521.1306960464.14074.digitalmars-d-le...@puremagic.com... > > >From my understanding of this page > > http://msdn.microsoft.com/en-us/library/dd318136%28v=vs.85%29.aspx : > > > > "Note Th

Re: how to get the local?

2011-06-01 Thread Nick Sabalausky
"Andrej Mitrovic" wrote in message news:mailman.521.1306960464.14074.digitalmars-d-le...@puremagic.com... > >From my understanding of this page > http://msdn.microsoft.com/en-us/library/dd318136%28v=vs.85%29.aspx : > > "Note The application should call this function in preference to > GetUserDef

Stack traces when stack overflow

2011-06-01 Thread bearophile
This crashes at runtime because of a stack overflow, without stack frame or error message (DMD 2.053), no stack trace, or line number are shown: int foo(int n) { return n ? foo(n - 1) : 1; } void main() { foo(100_000); } If you aren't running a debugger then receiving a nude crash is n

Re: 2 question: internationalization and serialization

2011-06-01 Thread Jérôme M. Berger
Andrej Mitrovic wrote: > You need mercurial and do 'hg clone > http://hg.dsource.org/projects/orange' from the command line. Or you can just click on the "zip", "gz" or "bz2" button at the top of http://hg.dsource.org/projects/orange if you do not care about the history. J

Re: how to get the local?

2011-06-01 Thread Andrej Mitrovic
On 6/1/11, Steven Schveighoffer wrote: > On Wed, 01 Jun 2011 16:38:05 -0400, Andrej Mitrovic > wrote: > >> I beat you Steven!! >> >> :P > > According to my newsreader and webnews, I beat you by 2 seconds: > > http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_

Re: how to get the local?

2011-06-01 Thread Lloyd Dupont
Thanks, I'll have a look tonight! "Steven Schveighoffer" wrote in message news:op.vwezfbqmeav7ka@localhost.localdomain... On Wed, 01 Jun 2011 16:13:44 -0400, Lloyd Dupont wrote: Here is my new theory -- note that the function is only defined on Vista or later. DMD does not use the same obj

Re: how to get the local?

2011-06-01 Thread Lloyd Dupont
Thanks for the quick answers hey! Another quick one (it's time to go to work for me!) Does this lib contains the MSI function? "Andrej Mitrovic" wrote in message news:mailman.518.1306939098.14074.digitalmars-d-le...@puremagic.com... From what I can tell you're using the wide version, so try

Re: how to get the local?

2011-06-01 Thread Steven Schveighoffer
On Wed, 01 Jun 2011 16:38:05 -0400, Andrej Mitrovic wrote: I beat you Steven!! :P According to my newsreader and webnews, I beat you by 2 seconds: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=27286 FromAndrej Mitrovic DateWed, 1 Jun

Re: how to get the local?

2011-06-01 Thread Andrej Mitrovic
I beat you Steven!! :P

Re: 2 question: internationalization and serialization

2011-06-01 Thread Andrej Mitrovic
You need mercurial and do 'hg clone http://hg.dsource.org/projects/orange' from the command line.

Re: how to get the local?

2011-06-01 Thread Steven Schveighoffer
On Wed, 01 Jun 2011 16:13:44 -0400, Lloyd Dupont wrote: Thanks for the link hey! :) Otherwise I still get the same linking error with the W :( It looks like that particular function does not have the A and W versions. See this page: http://msdn.microsoft.com/en-us/library/dd318136%28v=vs.

Re: how to get the local?

2011-06-01 Thread Andrej Mitrovic
>From my understanding of this page http://msdn.microsoft.com/en-us/library/dd318136%28v=vs.85%29.aspx : "Note The application should call this function in preference to GetUserDefaultLCID if designed to run only on Windows Vista and later." It's not in kernel32.lib distributed with DMD. You wou

Re: 2 question: internationalization and serialization

2011-06-01 Thread Lloyd Dupont
I'm looking! mm... how do I download the repository!?! :~ "Jacob Carlborg" wrote in message news:is5msf$1lt0$1...@digitalmars.com... For the serialization you could have a look at Orange: http://www.dsource.org/projects/orange Don't know if it works with the latest compilers, it's been a whi

Re: 2 question: internationalization and serialization

2011-06-01 Thread Lloyd Dupont
Awesome! WIll take a look at it tonight! Thanks for the link! :) "Jacob Carlborg" wrote in message news:is5msf$1lt0$1...@digitalmars.com... On 2011-06-01 14:51, Lloyd Dupont wrote: Hi I'm a newbie with big ambitions! (Sorry, got spoiled by C#) Anyhow I'm toying with a D learning project and

Re: how to get the local?

2011-06-01 Thread Lloyd Dupont
Thanks for the link hey! :) Otherwise I still get the same linking error with the W :( "Andrej Mitrovic" wrote in message news:mailman.518.1306939098.14074.digitalmars-d-le...@puremagic.com... From what I can tell you're using the wide version, so try prototyping it as GetUserDefaultLocale

Re: Clear big AAs

2011-06-01 Thread bearophile
useo: > Is there anything I forgot to consider? If the key and values are primitive values or structs of primitive values then you may try another AA implementation that doesn't use the GC. Bye, bearophile

Re: Clear big AAs

2011-06-01 Thread useo
== Auszug aus David Nadlinger (s...@klickverbot.at)'s Artikel > I realize that this might sound strange, but try setting myAA to null > after clear(), this should fix the crash. > David > On 5/31/11 4:00 PM, useo wrote: > > Hi, > > > > I'm trying to clear big associative arrays, but I always get an

Re: 2 question: internationalization and serialization

2011-06-01 Thread Jacob Carlborg
On 2011-06-01 14:51, Lloyd Dupont wrote: Hi I'm a newbie with big ambitions! (Sorry, got spoiled by C#) Anyhow I'm toying with a D learning project and there are 2 .NET feature that will be welcome in this D project: 1. internationalization. the app will contains a bunch of simple UIs and I was

Re: nested class inheritance

2011-06-01 Thread Simen Kjaeraas
On Wed, 01 Jun 2011 01:57:52 +0200, Michael Shulman wrote: I've also realized that my proposed workaround actually doesn't work, because 'alias this' doesn't actually behave like subclassing with respect to references. That is, if Inner2 is 'alias this'ed to Inner1, and I try to pass an Inne

Re: how to get the local?

2011-06-01 Thread Don
Lloyd Dupont wrote: I tried to add that to my D file === public import std.c.windows.windows; extern(Windows) { int GetUserDefaultLocaleName(LPWSTR lpLocaleName, int cchLocaleName); } === Try: extern(Windows) { int GetUserDefaultLocaleNameW(LPWSTR lpLocaleName, int cchLocaleName); } and

Re: how to get the local?

2011-06-01 Thread Steven Schveighoffer
On Wed, 01 Jun 2011 10:31:45 -0400, Lloyd Dupont wrote: I tried to add that to my D file === public import std.c.windows.windows; extern(Windows) { int GetUserDefaultLocaleName(LPWSTR lpLocaleName, int cchLocaleName); } === and compile and link to kernel32.lib But I got the following co

Re: how to get the local?

2011-06-01 Thread Andrej Mitrovic
>From what I can tell you're using the wide version, so try prototyping it as GetUserDefaultLocaleNameW <- note the W Otherwise you should really get http://dsource.org/projects/bindings/wiki/WindowsApi , which has prototypes for many windows functions. You just have to build and use it with --ver

Re: how to get the local?

2011-06-01 Thread Lloyd Dupont
I tried to add that to my D file === public import std.c.windows.windows; extern(Windows) { int GetUserDefaultLocaleName(LPWSTR lpLocaleName, int cchLocaleName); } === and compile and link to kernel32.lib But I got the following compile error: Error1Error 42: Symbol Undefined _GetUser

how to get the local?

2011-06-01 Thread Lloyd Dupont
I'm on a windows PC in Australia I'd like to get the string "en-AU" and "en" from Windows How do I do that please?

Re: 2 question: internationalization and serialization

2011-06-01 Thread Lloyd Dupont
I found half the answer to question 1 (internationalization) I still dunno how to get the local language (I guess I'll have to find the win32 method which return it) but I found how to do the resources!! (using mixins) what do you think? === D file === string[string][string] lang; mixin(impor

2 question: internationalization and serialization

2011-06-01 Thread Lloyd Dupont
Hi I'm a newbie with big ambitions! (Sorry, got spoiled by C#) Anyhow I'm toying with a D learning project and there are 2 .NET feature that will be welcome in this D project: 1. internationalization. the app will contains a bunch of simple UIs and I was wondering how I would go on internatio