error C3481: 'Out': lambda capture variable not found while calling ObjectIDGenerator.GetID in C++/CLI

StackOverflow https://stackoverflow.com/questions/17025077

Pergunta

I need to pass a boolean value in the ObjectIDGenerator.GetID(Object^,out bool) in C++/CLI. Having a similar problem as described here. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/2ec8e666-ecac-491e-bfb1-1b9108f7eb92 Searched over the net for this class.. New to this error and to the concept of Lambda. So read THIS Still getting the above error..What am I doing wrong?

Foi útil?

Solução

Just pass an lvalue of type bool:

ObjectIDGenerator ^generator;
Object ^o;
bool isFirst;
generator->GetID(o, isFirst);

There are no lambdas involved. The reason for your error is that you must have stuck [Out] somewhere in your code, which looked to the compiler like a lambda. But [Out] is never used when calling a function.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top