Dear all,
sorry to annoy you again with the same question: how to get the ARtoolkit working with MFC ?
Following your answers to previous questions, here is how my application is running:
1-Loading the patterns
2-Starting the MFC application
3-When pressing a START MFC button :
3.1-creating and showing an instance of a CStatic class: this instance is a WS_CHILD of the main MFC window. This instance has 2 attributes: an HDC and a HGLRC (I think it's required to select the area in which OpenGL and video must be drawn)
3.2-initialisation of the camera with these functions:
arVideoOpen
arVideoInqSize
arParamLoad
arParamChangeSize
arInitCparam
arParamDisp
argInit
arVideoCapStart
3.3-starting a loop while(TRACK) // track becomes false when the STOP MFC button is pressed
3.3.1-arVideoGetImage
3.3.2-argDrawMode2D
3.3.3-argDispImage
3.3.4-arDetectMarker
3.3.5-arGetTransMat
3.3.6-draw + swapBuffer
3.3.7-arVideoCapNext
3.3.8-while (PeekMessage( &WmMsg, NULL, 0, 0,PM_REMOVE))
{DispatchMessage(&WmMsg);} // local MFC event-loop to dispatch all the events (swapBuffer, buton pressed, ...)
3.3.9-back to the begining of the loop (3.3) while the STOP button has not been pressed.
3.4-//loop terminated: arVideoCapStop , arVideoClose
And the result is that the video is displayed and as soon as it detects a marker ... my application return an error box which title is "MS Visual-C++ Debug Library" and the text is approx. Debug assertion failed: _CrtCheckMemory ..."
I'm now using the 2.65f version of the ARtoolkit, in the Debug mode, with VisualC++.Net on a XPpro-PC with a simple WebCam from Logitech (same trouble occur with another WebCam: Trust) in Debug Mode.
Using the same camera param file, pattern descr. files with the simple.exe application run correctly ...
I don't know anymore where to look at.
Does anyone have an idea? maybe around the initialisation of the MFC-OpenGl drawing area ? or in the way the DSLib must be used (what to do with libmmd.lib ? the files .ax and regsvr32.exe ... it's quite obscur to me.)
Thanks a lot in advance
E.D.
Emmanuel DUBOIS ! Emmanuel.Dubois@i ......
UPS - IRIT - LIIHS ! www.irit.fr/recherches/LIIHS/dubois
118, route de Narbonne ! Phone: +33 (0)5 61 55 63 59
F - 31 062 Toulouse Cedex 4 ! Fax: +33 (0)5 61 55 62 58
|