我要发帖 回复

新手上路

5

主题

17

积分

0

专家分

:

私信
发表时间 : 2011-11-30 11:35:09 | 浏览 : 1733    评论 : 6
CVega_MFCView::CVega_MFCView()
{
        // TODO: add construction code here
        int result; // vsgu::SUCCESS or vsgu::FAILURE
   
    result = vp::initialize(__argc,__argv);
    assert(result == vsgu::SUCCESS);

    // set acf file
    //string acfFile;

    //if (__argc <= 1)
    //    acfFile = "mytest.acf";  //vp_mfc.acf
    //else
    //    acfFile = __argv[1];

    // load acf file
    result = vpKernel::instance()->define("mytest.acf");
    assert(result == vsgu::SUCCESS);

        vpApp *app=new vpApp;

        
    // configure Vega Prime
    result = vpKernel::instance()->configure();
    assert(result == vsgu::SUCCESS);


    // assuming at least one window in acf
    assert(vpWindow::size() != 0);

    // get the first Vega Prime window
    vpWindow *vpWin = *vpWindow::begin();

    // set this MFC View window as the parent of the Vega Prime window
    vpWin->setParent(m_hWnd);

    // remove the Vega Prime border (use MFC parent window border instead)
    vpWin->setBorderEnable(false);

    // let MFC parent window determine our size by filling the MFC parent
    // window frame
    vpWin->setFullScreenEnable(true);




    // We can force the Vega Prime window open by calling beginFrame/endFrame
   
    //   NOTE: OnActivateView requires the Vega Prime window open before it is
    //         called.  If it is not open, the Vega Prime window will never
    //         get focus and thus will not handle keyboard input.

    int frameNum = vpKernel::instance()->beginFrame();
    assert(frameNum != 0);

    result = vpKernel::instance()->endFrame();
    assert(result == vsgu::SUCCESS);



    // setup timer that updates frame

    //   NOTE: Timer messages (WM_TIMER) are low priority messages.  They
    //         are processed after all other messages have been processed.
    //         Updating frames this way makes the application more responsive
    //         at the expense of frame updates.

    // Timeout of 16 means send a WM_TIMER message at 60Hz.

    const int TIMER_ID = 1;
    int timeout = 16;
    int returnValue = SetTimer(TIMER_ID, timeout, NULL);   
    assert(returnValue == TIMER_ID);
}
运行到第一句vp::initialize(__argc,__argv)便陷入死循环 提示如下:
Unhandled exception at 0x005cb91e (vsgu2_2D.dll) in Vega_MFC.exe: 0xC0000005: Access violation reading location 0x00000000. 是什么问题

最近VR访客

sichuanwww 评论于2011-12-1 08:52:14
写错了吧
努力挣钱,快乐生活!
wgb19880119 评论于2011-12-5 14:37:01
sichuanwww 发表于 2011-12-1 08:52 AM
写错了吧

我也遇到过这个问题,怎么错的牙?
wgb19880119 评论于2011-12-5 14:38:32
楼主知道怎么回事了没啊?
angelajer 评论于2012-3-8 15:51:06
楼主现在解决的了吗?急需求解
lizhengm100 评论于2013-4-14 11:15:35
翻看了一遍帖子,两三个都是这个问题,但是都没有解决办法呢,哪位解决了问题的指点下迷津啊
study_jmgc专家组 评论于2013-5-23 19:12:28 来自手机
使用多字节字符集!

手机版|VR开发网 统计 津ICP备18009691号
网安备12019202000257

GMT+8, 2021-1-18 09:01 PM

返回顶部