- 积分
- 169
- 帖子
- 56
- 主题
- 9
- 精华
- 0
- 最后登录
- 2012-11-30
- 在线时间
- 44 小时
中级会员
兴趣点(最多三项):
建模技术
视景仿真
地形仿真
- 私信
|
发表时间 : 2011-11-23 21:41:10
|
浏览 : 1229 评论 : 5
C:\vp错误报告.jpg环境介绍:vegaprime2.2.1+vs2005(有装SP1补丁)。我设计的思路是这样的,做一个基于对话框的程序,在BOOL Cvp111Dlg::OnInitDialog()中加入:
int result;
result = vp::initialize(__argc, __argv);
assert(result == vsgu::SUCCESS);
CString acfFile;
if (__argc <= 1)
acfFile = "**.acf";
else
acfFile = __argv[1];
app=new vpApp;
app->define((const char *)&acfFile);
app->configure();
在OnBnClickedButton1函数中激活一个定时器:
const int TIMER_ID = 1;
int timeout = 16;
int returnValue = SetTimer(TIMER_ID, timeout, NULL);
assert(returnValue == TIMER_ID);
另外写了个ontimer函数:
void Cvp111Dlg::OnTimer(UINT nIDEvent)
{
extern BOOL isrun;
if (isrun==TRUE)
{
app->beginFrame();
app->endFrame();
}
CWnd::OnTimer(nIDEvent);
}
最后程序退出是在对话框类的析构函数中:
Cvp111Dlg::~Cvp111Dlg()
{
app->breakFrameLoop();
// Allow VP to exit from frame loop
int frameNum =app->beginFrame();
assert(frameNum == 0);
int result; // vsgu::SUCCESS or vsgu::FAILURE
result = app->unconfigure();
assert(result == vsgu::SUCCESS);
result = vp::shutdown();
assert(result == vsgu::SUCCESS);
}
程序生成没有问题,但是一运行就会出现如图的错误
请高手指点啊 |
|