请帮我看一下吧,都愁死了,我想点初始化的按钮,运行一会就显示“初始化已完成”,但为什么编译没错,能运行,但是运行一会儿窗口就自动关闭了,也没有什么显示, 调试里显示The thread 0xEAC has exited with code 1 (0x1) void CText0Dlg::On_CHUSHIHUA() { int NUM_FRAMES=m_FRAME; int NUM_MARKERS=m_MARKERS_PORT1; unsigned int uFlags, uElements, uFrameCnt, uMarkerCnt, uFrameNumber; static Position3d p3dData[10000]; char szNDErrorString[MAX_ERROR_STRING_LENGTH + 1]; /* * Announce that the program has started */ /* * look for the -nodld parameter that indicates 'no download' */ /* * Load the system of processors. */ if( TransputerLoadSystem( "system" ) != OPTO_NO_ERROR_CODE ) { goto ERROR_EXIT; } /* if */ Sleep( 1 ); /* * Wait one second to let the system finish loading. */ Sleep( 1 ); /* * Initialize the processors system. */ if( TransputerInitializeSystem( OPTO_LOG_ERRORS_FLAG | OPTO_LOG_MESSAGES_FLAG ) ) { goto ERROR_EXIT; } /* if */ /* * Set optional processing flags (this overides the settings in Optotrak.INI). */ if( OptotrakSetProcessingFlags( OPTO_LIB_POLL_REAL_DATA | OPTO_CONVERT_ON_HOST | OPTO_RIGID_ON_HOST ) ) { goto ERROR_EXIT; } /* if */ /* * Load the standard camera parameters. */ if( OptotrakLoadCameraParameters( "standard" ) ) { goto ERROR_EXIT; } /* if */ /* * Set the strober port table */ if( OptotrakSetStroberPortTable( m_MARKERS_PORT1, 0, 0, 0 ) ) { goto ERROR_EXIT; } /* if */ /* * Set up a collection for the Optotrak. */ if( OptotrakSetupCollection( NUM_MARKERS, /* Number of markers in the collection. */ (float)m_FREQUENCE, /* Frequency to collect data frames at. *///采样频率 (float)2500.0, /* Marker frequency for marker maximum on-time. */ 30, /* Dynamic or Static Threshold value to use. */ 160, /* Minimum gain code amplification to use. */ 0, /* Stream mode for the data buffers. */ (float)0.35, /* Marker Duty Cycle to use. */ (float)7.0, /* Voltage to use when turning on markers. */ (float)1.0, /* Number of seconds of data to collect. */ (float)0.0, /* Number of seconds to pre-trigger data by. */ OPTOTRAK_NO_FIRE_MARKERS_FLAG | OPTOTRAK_BUFFER_RAW_FLAG | OPTOTRAK_GET_NEXT_FRAME_FLAG ) ) { goto ERROR_EXIT; } /* if */ /* * Wait one second to let the camera adjust. */ Sleep( 1 ); /* * Activate the markers. */ if( OptotrakActivateMarkers() ) { goto ERROR_EXIT; } /* if */ Sleep( 1 ); /* * Get and display ten frames of 3D data. */ MessageBox("初始化已完成"); ERROR_EXIT: /* * Indicate that an error has occurred */ ((CListBox*)GetDlgItem(IDC_LIST1))->AddString("\nAn error has occurred during execution of the program.\n" ); //fprintf( stdout, "\nAn error has occurred during execution of the program.\n" ); if( OptotrakGetErrorString( szNDErrorString, MAX_ERROR_STRING_LENGTH + 1 ) == 0 ) { ((CListBox*)GetDlgItem(IDC_LIST1))->AddString(szNDErrorString ); //fprintf( stdout, szNDErrorString ); } /* if */ ((CListBox*)GetDlgItem(IDC_LIST1))->AddString("\n\n...TransputerShutdownSystem\n" ); //fprintf( stdout, "\n\n...TransputerShutdownSystem\n" ); OptotrakDeActivateMarkers(); TransputerShutdownSystem(); exit( 1 ); }