Home > Software engineering >  VS2013 & C (MFC) & Kinect2 are not allowed to use return the function of an abstract class
VS2013 & C (MFC) & Kinect2 are not allowed to use return the function of an abstract class

Time:10-29

I will Kinect1 Kinect2 transplanted to the a algorithm of the above problems, the Internet search, strives for the great god help to solve, the next grateful
This is the original code of K1
 NUI_SKELETON_FRAME standardization (NUI_SKELETON_FRAME skeletonFrame) {
for (int i=0; i For (int r=0; R & lt; 20; R++) {
SkeletonFrame. SkeletonData [I] SkeletonPositions [r]=bz (skeletonFrame. SkeletonData [I] SkeletonPositions [r], skeletonFrame. SkeletonData [I] SkeletonPositions [0]).
}
}
Return skeletonFrame;
}

I rewrite the K2 code after
 IBodyFrameReader standardization (IBodyFrameReader skeletonFrame) {
for (int i=0; i <body_COUNT; I++) {
For (int r=0; R & lt; 25. R++) {
SkeletonFrame. SkeletonData [I] SkeletonPositions [r]=bz (skeletonFrame. SkeletonData [I] SkeletonPositions [r], skeletonFrame. SkeletonData [I] SkeletonPositions [0]).
}
}
Return skeletonFrame;
}

This is where the program error

CodePudding user response:

Using pointer form

CodePudding user response:

Don't know much about the guidance

CodePudding user response:

You return is an object that is pure virtual object classes, although the memory can be changed, but no data itself does not conform to the grammar specification.

There was a bug on the k1, k2 on a more strict check, you will pass it.

Can change to return a pointer or reference

NUI_SKELETON_FRAME standardization (NUI_SKELETON_FRAME skeletonFrame)
Change
NUI_SKELETON_FRAME & amp; standardization (NUI_SKELETON_FRAME skeletonFrame)
Or
NUI_SKELETON_FRAME * standardization (NUI_SKELETON_FRAME skeletonFrame)//attention to Pointers, ruturn statements need to use & amp; Pick up address.

At the back of the function is similar to

CodePudding user response:

But deny the K2 NUI_SKELETON_FRAM ah, write down according to your tip the NUI_SKELETON_FRAME is undefined identifiers

CodePudding user response:

Good big because in
  • Related