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] nos...@home.com wrote: On 2/27/2011 8:52 AM, Simen kjaeraas wrote: Tyro[a.c.edwards] nos...@home.com wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller

Re: Initializing a class pointer

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

Initializing a class pointer

2011-02-26 Thread Tyro[a.c.edwards]
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 = (new

Re: Initializing a class pointer

2011-02-26 Thread Simen kjaeraas
Tyro[a.c.edwards] nos...@home.com 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 //

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] nos...@home.com 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*

Re: Initializing a class pointer

2011-02-26 Thread Simen kjaeraas
Tyro[a.c.edwards] nos...@home.com wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLongController * (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Controller (hwnd, reinterpret_castCREATESTRUCT *

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] nos...@home.com wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLongController * (hwnd); . . . switch(msg) { case FirstMatch: pCtrl = new Controller (hwnd,

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] nos...@home.com wrote: I'm trying to convert some c++ code that defines T func(par...) { Controller * pCtrl = WinGetLongController * (hwnd); . . . switch(msg) { case FirstMatch: pCtrl

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)