- 积分
- 120
- 帖子
- 79
- 主题
- 16
- 精华
- 0
- 最后登录
- 2011-3-22
- 在线时间
- 64 小时
- 私信
|
发表时间 : 2010-3-19 15:08:49
|
浏览 : 1957 评论 : 12
在一般的Win32应用程序中,俺的dof part可以找到,但是现在在mfc框架下却怎么也找不到,程序贴出来,大家帮忙看看
wheelq = vgFindPart(f16,"qlq",NULL);
wheelz = vgFindPart(f16,"qlz",NULL);
wheely = vgFindPart(f16,"qly",NULL); 这几个都返回为空
UINT runVegaProc(LPVOID pParam)
{
CVRSimuView *hParent=(CVRSimuView*)pParam;
vgInitWinSys(AfxGetInstanceHandle(),hParent->GetSafeHwnd());
hParent->setVegaInitted(TRUE);
// hParent->postInitted();
vgDefineSys(".\\FighterSimu.adf");
hParent->setVegaDefined(TRUE);
hParent->postDefined();
vgConfigSys();
hParent->setVegaConfiged(TRUE);
// hParent->postConfiged();
while(hParent->getVegaRunning())
{
vgSyncFrame();
// hParent->postSync();
vgFrame();
hParent->postFrame();
}
hParent->setVegaInitted(FALSE);
// vgExit(0);
return 0;
}
void CVRSimuView::runVega()
{
isRunning=TRUE;
if(m_pVegaThread==NULL)
{m_pVegaThread=AfxBeginThread(
runVegaProc,
this,
THREAD_PRIORITY_NORMAL,
0,
0,
NULL
);
}
while(!getVegaDefined())
{
Sleep(10);
}
win=vgGetWin(0);
if(win==NULL)
{
vgNotify(VG_FATAL,VG_APP,"ERROR:No Vega window Defined--check %s",getAdfName());
exit(-1);
}
env=vgGetEnv(0);
if(env==NULL)
{
vgNotify(VG_FATAL,VG_APP,"ERROR:Couldn't find env--check %s",getAdfName());
exit(-1);
}
scn=vgFindScene("Default");
assert(scn);
gfx = vgFindGfx("Default");
assert(gfx);
main_obs = vgFindObserv("fighter_obs");
main_chan = vgFindChan("main_chan");
// f16u = vgFindObj("fighter");
player = vgFindPlyr("fighter_player");
f16 = vgFindObj("f16u");
wheelq = vgFindPart(f16,"qlq",NULL);
wheelz = vgFindPart(f16,"qlz",NULL);
wheely = vgFindPart(f16,"qly",NULL);
} |
|