Re: trouble calling function from windows dll

2012-03-25 Thread John Chapman
On Saturday, 24 March 2012 at 19:11:38 UTC, maarten van damme wrote: hi, I'm trying to call NtUnmapViewOfSection from ntdll.dll. According to the msdn docs it should look like NTSTATUS NtUnmapViewOfSection( __in HANDLE ProcessHandle, __in_opt PVOID BaseAddress ); I tried to call it

Re: trouble calling function from windows dll

2012-03-25 Thread John Chapman
On Saturday, 24 March 2012 at 19:11:38 UTC, maarten van damme wrote: hi, I'm trying to call NtUnmapViewOfSection from ntdll.dll. According to the msdn docs it should look like NTSTATUS NtUnmapViewOfSection( __in HANDLE ProcessHandle, __in_opt PVOID BaseAddress ); I tried to call it

Re: trouble calling function from windows dll

2012-03-25 Thread maarten van damme
I did not import ntoskrnl.lib because I'm trying to do everything in user mode and there I have access to ntdll.dll which contains ntunmapviewofsection. Thats why I started using implib to create an ntdll.dll import library but I couldn't get it to work. It's good to know that it actually returns

Re: trouble calling function from windows dll

2012-03-25 Thread maarten van damme
Turns out it indeed got the right function pointer and that function is getting called correctly. What I was trying to do however was forking a process within another. One of the things I needed to do was unmapping the base module from memory from one of the exe's, align correctly and then write th

Re: trouble calling function from windows dll

2012-03-25 Thread maarten van damme
While I was playing around some more I noticed that the optimize flag causes my program to give an access violation while normal compilation doesn't give any error whatsoever. is this an old bug or have I stumbled upon a new bug?

Parser (not parser generators) and ctfe

2012-03-25 Thread Andrea Fontana
Does it exists a working ctfe parser for xml or ini or something suitable for config file? Something that import() file and reads values at compile times. For example: On my (php) website I use an optimized c++ backend (compiled as php module). Profiling code I see that website wastes a lot of

GUI library

2012-03-25 Thread Tyro[17]
Is there one available for use with D2 on MAC OS X? Thanks, Andrew

Re: GUI library

2012-03-25 Thread Jacob Carlborg
On 2012-03-25 15:04, Tyro[17] wrote: Is there one available for use with D2 on MAC OS X? Thanks, Andrew I think these are the choices on Mac OS X: * gtkD - Bindings to GTK. Does not use the native drawing operations of the operating system. Available on all platforms. http://dsource.org/pr

Re: GUI library

2012-03-25 Thread Kevin Cox
On Sun, Mar 25, 2012 at 11:13 AM, Jacob Carlborg wrote: > On 2012-03-25 15:04, Tyro[17] wrote: > >> Is there one available for use with D2 on MAC OS X? >> >> Thanks, >> Andrew >> > > * QtD - Bindings to Qt. Use the native drawing operations of the operating > system (I think). Available on all pl

std.json

2012-03-25 Thread AaronP
Could I get a "hello, world" example of parsing json? The docs look simple enough, but I could still use an example.

Re: GUI library

2012-03-25 Thread Jacob Carlborg
On 2012-03-25 17:22, Kevin Cox wrote: I would reccomend Qt as well. You will get native cross-platform widgets with great performance. I am not sure how far QtD is but I know it once had a lot of development on it. I don't think Qt is uses the native drawing operations on Mac OS X. -- /Jacob

Problem with receiveOnly and classes

2012-03-25 Thread Ghislain
Hello, I need to pass objects of a hierarchy between threads and I have some troubles. The sample code below displays: Unknown B.fun() I do not understand why an object of type A is fetched as a Variant, while a object of type B is received correctly. Instead of (A a){a.fun();} I als

Re: std.json

2012-03-25 Thread Andrea Fontana
Hope it's clear... import std.json; import std.stdio; void main(string args[]) { JSONValue json = parseJSON(q"EOS { "key" : { "subkey1" : "str_val", "subkey2" : [1,2,3], "subkey3" : 3.1415 } } EOS"); writeln

Re: std.json

2012-03-25 Thread AaronP
On 03/25/2012 12:50 PM, Andrea Fontana wrote: Hope it's clear... import std.json; import std.stdio; void main(string args[]) { JSONValue json = parseJSON(q"EOS { "key" : { "subkey1" : "str_val", "subkey2" : [1,2,3], "subkey3" : 3.1415 } } EOS"); writeln(json.object["key"].object["subkey1"].str

GC collecting "too much"..

2012-03-25 Thread simendsjo
I'm doing some coding against a c library, and Ds GC keeps collecting c owned objects (I think - disabling the GC makes everything work) But how can I figure out what the GC is (read: I am) fucking up? I have some to!string(c_struct_field) and format("%s", c_struct_field) and field = c_fields[

Re: GC collecting "too much"..

2012-03-25 Thread bearophile
On Sunday, 25 March 2012 at 19:15:05 UTC, simendsjo wrote: I'm doing some coding against a c library, and Ds GC keeps collecting c owned objects (I think - disabling the GC makes everything work) Three alternative solutions: - Allocate from the C heap the memory that C will need to use, and f

opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
How do I "call" opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, "abc", 4L, 3.33); Instead I would prefer fm.list = (1, "abc", 4L, 3.33); Is this somehow possible ? import std.variant; im

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread James Miller
On 26 March 2012 09:45, bls wrote: > How do I "call" opDispatch(string name, E...)(E elements) ? > What I want to archive is to call f.i. fm.list with an arbitrary number of > arguments without using > > fm.list(1, "abc", 4L, 3.33); > > Instead I would prefer > fm.list = (1, "abc", 4L, 3.33); You

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
On 03/25/2012 02:04 PM, James Miller wrote: On 26 March 2012 09:45, bls wrote: How do I "call" opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, "abc", 4L, 3.33); Instead I would prefer fm.

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread James Miller
On 26 March 2012 10:34, bls wrote: > > (T) (T[] t) AND (T) (T t) seems not to work. Ok, so looking here: http://dlang.org/function.html, I have determined that, if you are using Variant arrays (though I'm not sure if you can do that using literals...) you can use the syntax from this example: in

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
On 03/25/2012 02:59 PM, James Miller wrote: Ok, so looking here:http://dlang.org/function.html, I have determined that, if you are using Variant arrays (though I'm not sure if you can do that using literals...) you can use the syntax from this example: Thanks James.. will give it tomorrow a new

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread Artur Skawina
On 03/25/12 22:45, bls wrote: > How do I "call" opDispatch(string name, E...)(E elements) ? > What I want to archive is to call f.i. fm.list with an arbitrary number of > arguments without using > > fm.list(1, "abc", 4L, 3.33); > > Instead I would prefer > fm.list = (1, "abc", 4L, 3.33); > > Is

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread bls
Thanks Artur, On 03/25/2012 03:18 PM, Artur Skawina wrote: On 03/25/12 22:45, bls wrote: How do I "call" opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, "abc", 4L, 3.33); Instead I would

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread Simen Kjærås
On Sun, 25 Mar 2012 22:45:57 +0200, bls wrote: How do I "call" opDispatch(string name, E...)(E elements) ? What I want to archive is to call f.i. fm.list with an arbitrary number of arguments without using fm.list(1, "abc", 4L, 3.33); Instead I would prefer fm.list = (1, "abc", 4L, 3.33);

Re: opDispatch(string name, E...) (E e) question.

2012-03-25 Thread Artur Skawina
On 03/26/12 00:58, bls wrote: > Thanks Artur, > > On 03/25/2012 03:18 PM, Artur Skawina wrote: >> On 03/25/12 22:45, bls wrote: >>> How do I "call" opDispatch(string name, E...)(E elements) ? >>> What I want to archive is to call f.i. fm.list with an arbitrary number of >>> arguments without usin

Rewrite of std.range docs (Was: Re: Making sense of ranges)

2012-03-25 Thread H. S. Teoh
On Sat, Mar 24, 2012 at 06:19:32PM +, Stewart Gordon wrote: > The documentation for std.range states > > http://dlang.org/phobos/std_range.html > "This module defines the notion of range (by the membership tests > isInputRange, isForwardRange, isBidirectionalRange, > isRandomAccessRange), rang

Re: Map with maintained insertion order

2012-03-25 Thread Michael Rynn
On Fri, 23 Mar 2012 23:48:51 +0100, Andrej Mitrovic wrote: > Does someone have a map implementation that maintains the insertion > order of the keys? > > E.g.: > > string[string] map; > map["foo"] = "x"; > map["bar"] = "y"; > > When iterating over map keys I want to visit "foo" first, then "bar