我需要在C ++ / CLI中的ObjectIDGenerator.GetID(Object ^,out bool)中传递一个布尔值。 遇到类似这里描述的问题。 http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/2ec8e666-ecac-491e-bfb1-1b9108f7eb92通过网络搜索此课程..此错误的新内容和Lambda的概念。 所以阅读这仍然得到上述错误..我做错了什么?
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?
最满意答案
只需传递一个bool类型的左值:
ObjectIDGenerator ^generator; Object ^o; bool isFirst; generator->GetID(o, isFirst);没有涉及lambdas。 你的错误的原因是你必须在代码中的某个地方卡住[Out] ,这样看起来像编译器就像lambda一样。 但是在调用函数时从不使用[Out] 。
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.
更多推荐
发布评论