Error 1 error C2440: 'return' : cannot convert from 'ZXNewtonCP::LayoutManager' to 'ZXNewtonCP::LayoutManager' d:\proyectos\rfog\zxnewtoncp\zxnewtoncp\Config.h 17
LayoutManager is a managed class, and is instantiated in class config as a stack type, not a reference or pointer.
My intention was to return a reference, but I mistake the typing and got that error. I don’t know if system can return a complete class instead a reference, but the error sounds cryptic and obscure.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Public ref class LayoutManager {…}
Public ref class Config
{
LayoutManager layoutManager;
…
property LayoutManager GetLayout
{
LayoutManager get(void) {return layoutManager;}
}

Error C2440: cannot convert from type to type
Phillip M. Hoff
Thanks,
Ayman Shoukry
VC++ Team
JustDave
What do you want to do Do you want to create a new object You need to use gcnew/new for this.
Bartosz Bien
I've done yet. Thanks.
soundman32
My comment is about the cryptic error message to say that I cannot return a complete class. Message error could say "Error C<bla>: Is not allowed to return a complete[or stack allocated or non-referenced] managed class. Return a reference instead", or similar.
Dennis Rose
This sounds like something you should open a new bug on. I've opened one or two asking for clearer diagnostics myself.
Brian
cgMarcos
Thanks,
Ayman Shoukry
VC++ Team