Cannot convert of type HANDLE to HANDLE

2009-09-08 Thread Sam Hu
Under DMD 2.032+Window Xp: Can I use HMODULE LoadLibraryEx( LPCTSTR lpFileName, // file name of module HANDLE hFile, // reserved, must be NULL DWORD dwFlags // entry-point execution option ); in D2?Given below code : HMODULE hDll=LoadLibraryEx(toStringz("netmsg.dll"),

Re: delegate !is null

2009-09-08 Thread Steven Schveighoffer
On Sun, 06 Sep 2009 18:54:47 -0400, Saaa wrote: I'd like to set D's delegate to a method which is not yet available (like c.method). I solved this by encapsulating the method within a function literal, but I also need to know whether the method is available or not when calling the delegate.

Re: delegate !is null

2009-09-08 Thread Saaa
"Steven Schveighoffer" wrote in message news:op.uzxs4wyreav...@localhost.localdomain... > On Sun, 06 Sep 2009 18:54:47 -0400, Saaa wrote: > >> I'd like to set D's delegate to a method which is not yet available (like >> c.method). >> I solved this by encapsulating the method within a function l

Re: delegate !is null

2009-09-08 Thread Steven Schveighoffer
On Tue, 08 Sep 2009 09:22:30 -0400, Saaa wrote: "Steven Schveighoffer" wrote in message news:op.uzxs4wyreav...@localhost.localdomain... On Sun, 06 Sep 2009 18:54:47 -0400, Saaa wrote: I'd like to set D's delegate to a method which is not yet available (like c.method). I solved this by e

Re: delegate !is null

2009-09-08 Thread Saaa
>> The problem lies more in that I'd like to point to something which is not >> there yet. >> In the code 'c.method()' is not there yet, as c is null. >> Maybe I should create a dummy object for c to point to in stead of null ? >> That way I point the delegate to the dummy method and ignore it as l

Re: delegate !is null

2009-09-08 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Saaa wrote: >>> The problem lies more in that I'd like to point to something which is not >>> there yet. >>> In the code 'c.method()' is not there yet, as c is null. >>> Maybe I should create a dummy object for c to point to in stead of null ? >>> That

Re: delegate !is null

2009-09-08 Thread Steven Schveighoffer
On Tue, 08 Sep 2009 12:40:13 -0400, Saaa wrote: Hm... I'm still confused. Why not just set the delegate to null? Why do you need to have the delegate set to something? It is for the gui. I give it a list of things to display. And some of these things don't yet exist or can be deleted at an

Re: Cannot convert of type HANDLE to HANDLE

2009-09-08 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sam Hu wrote: > Under DMD 2.032+Window Xp: > > Can I use > > HMODULE LoadLibraryEx( > LPCTSTR lpFileName, // file name of module > HANDLE hFile, // reserved, must be NULL > DWORD dwFlags // entry-point execution option > );

Re: delegate !is null

2009-09-08 Thread Saaa
"Steven Schveighoffer" wrote in message news:op.uzyfzuvueav...@localhost.localdomain... > On Tue, 08 Sep 2009 16:15:49 -0400, Saaa wrote: > > >>> >>> // dg is now a "instanceless" delegate to C.method. >>> >>> dg.ptr = new C; >> So, nothing special under the hood, this would also work? >> C c=

Re: delegate !is null

2009-09-08 Thread Steven Schveighoffer
On Tue, 08 Sep 2009 16:15:49 -0400, Saaa wrote: // dg is now a "instanceless" delegate to C.method. dg.ptr = new C; So, nothing special under the hood, this would also work? C c= new C; dg.ptr = c; Yes, same thing. I also don't know how well it will work on interfaces. Very nice :) Mig

Re: delegate !is null

2009-09-08 Thread Saaa
>>> Hm... I'm still confused. Why not just set the delegate to null? Why >>> do >>> you need to have the delegate set to something? >> It is for the gui. I give it a list of things to display. >> And some of these things don't yet exist or can be deleted at any time. >> I'd like it to display th

Re: delegate !is null

2009-09-08 Thread Saaa
> > The only way I've found so far to do static binding like you are talking > about is using string mixins. I need to rethink stuff a bit, but mixins might be the solution. > My port of Atl's window classes uses a MFC > like message map: > > mixin messageMap!( > msgRangeHdlr!(WM_MOUSEFIRST, WM_

Re: delegate !is null

2009-09-08 Thread Saaa
Hope this one makes any sense :) C c = new C; C mouseOverObject = c; int delegate() deleg = &mouseOverObject.getSomeVariable; mouseOverObject = null; int value; void write() { if(deleg !is null) //how do I make this check for (mouseOverObject !is null)? { value = deleg(); } writefln( value); }

Re: delegate !is null

2009-09-08 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Saaa wrote: >> The only way I've found so far to do static binding like you are talking >> about is using string mixins. > I need to rethink stuff a bit, but mixins might be the solution. > >> My port of Atl's window classes uses a MFC >> like message

Re: Trying to get DMD bundled with libs

2009-09-08 Thread Joel Christensen
Jarrett Billingsley wrote: On Mon, Sep 7, 2009 at 6:44 AM, Joel Christensen wrote: div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joel Christensen wrote: I noticed you can get DMD bundled with various libraries. I found you had to login to another web site, but the registery page h

Re: Trying to get DMD bundled with libs

2009-09-08 Thread Jarrett Billingsley
On Tue, Sep 8, 2009 at 8:48 PM, Joel Christensen wrote: > Jarrett Billingsley wrote: >> >> On Mon, Sep 7, 2009 at 6:44 AM, Joel Christensen wrote: >>> >>> div0 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joel Christensen wrote: > > I noticed you can get DMD

Re: Trying to get DMD bundled with libs

2009-09-08 Thread Jarrett Billingsley
On Tue, Sep 8, 2009 at 9:17 PM, Jarrett Billingsley wrote: > On Tue, Sep 8, 2009 at 8:48 PM, Joel Christensen wrote: >> Jarrett Billingsley wrote: >>> >>> On Mon, Sep 7, 2009 at 6:44 AM, Joel Christensen wrote: div0 wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 >>

Re: Cannot convert of type HANDLE to HANDLE

2009-09-08 Thread Sam Hu
div0 Wrote: > You must have two different HANDLEs around. > The one in phobos is aliased to void* and there is no LoadLibraryEx call > in phobos, so you must be using something else. > Try using the FQN of the import where you are getting the LoadLibraryEx > from. Thanks for your help. Yeah.I use