Re: Initializing a class pointer

2011-02-28 Thread Tyro[a.c.edwards]
On 2/27/2011 10:39 PM, Steven Schveighoffer wrote: On Sat, 26 Feb 2011 19:46:18 -0500, Tyro[a.c.edwards] wrote: On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLong (hwnd); .

Re: Initializing a class pointer

2011-02-27 Thread Steven Schveighoffer
On Sat, 26 Feb 2011 19:46:18 -0500, Tyro[a.c.edwards] wrote: On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLong (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Con

Re: Initializing a class pointer

2011-02-26 Thread Bekenn
On 2/26/2011 5:33 PM, Tyro[a.c.edwards] wrote: Ok, that's essentially what I have, except that I used Controller pCtrl vice auto. WinGetLong however, is a template that calls GetWindowLongPtrA() and casts it's result (in this case) to Controller. GetWindowLongPtrA() returns LONG_PTR (aka int) and

Re: Initializing a class pointer

2011-02-26 Thread Tyro[a.c.edwards]
On 2/27/2011 9:46 AM, Tyro[a.c.edwards] wrote: On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLong (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Controller (hwnd, rei

Re: Initializing a class pointer

2011-02-26 Thread Tyro[a.c.edwards]
On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLong (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Controller (hwnd, reinterpret_cast (lParam)); break; } } I'm not sur

Re: Initializing a class pointer

2011-02-26 Thread Simen kjaeraas
Tyro[a.c.edwards] wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLong (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Controller (hwnd, reinterpret_cast (lParam)); break; } } I'm not su

Re: Initializing a class pointer

2011-02-26 Thread Tyro[a.c.edwards]
On 2/27/2011 8:10 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] wrote: class Class{} void main() { Class myClass; Class* pClass0 = &myClass; // OK Class* pClass1 = new Class; // Error: cannot implicitly convert [8] // expression (new Class) of type t.Class // to test.Class* Class* pClass2 = &

Re: Initializing a class pointer

2011-02-26 Thread Simen kjaeraas
Tyro[a.c.edwards] wrote: class Class{} void main() { Class myClass; Class* pClass0 = &myClass; // OK Class* pClass1 = new Class; // Error: cannot implicitly convert [8] // expression (new Class) of type t.Class // to test.Class*