导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页
    1. 主页
    2. zhangtanghua
    Z
    • 资料
    • 关注 0
    • 粉丝 0
    • 我的积分 105
    • 主题 1
    • 帖子 1
    • 最佳 0
    • 群组 0

    zhangtanghuaLV 2

    @zhangtanghua

    105
    积分
    0
    声望
    1
    资料浏览
    1
    帖子
    0
    粉丝
    0
    关注
    注册时间 最后登录

    zhangtanghua 取消关注 关注

    zhangtanghua 发布的最新帖子

    • V831方案MINIGUI创建窗口失败

      求教大神!!!
      V831方案用MINIGUI去实现界面显示。程序编译成功,但运行到窗口创建处出错。
      部分代码:
      int main (int args, const char* arg[])
      {
      MSG Msg;
      MAINWINCREATE CreateInfo;
      HWND hMainWnd;

      #ifdef _MGRM_PROCESSES
      JoinLayer (NAME_DEF_LAYER, arg[0], 0, 0);
      #endif

      InitCreateInfo (&CreateInfo);
      sm_debug("CreateMainWindow\n");
      
      hMainWnd = CreateMainWindow (&CreateInfo);
      if (hMainWnd == HWND_INVALID){
      	
      	sm_error("CreateMainWindow fail\n");
          return -1;
      }
      sm_debug("CreateMainWindow sucess\n");
      
      while (GetMessage (&Msg, hMainWnd)) {
          DispatchMessage (&Msg);
      }
      
      MainWindowThreadCleanup (hMainWnd);
      return 0;
      

      }

      创建窗口原函数:
      HWND GUIAPI CreateMainWindowEx (PMAINWINCREATE pCreateInfo,
      const char* werdr_name, const WINDOW_ELEMENT_ATTR* we_attrs,
      const char* window_name, const char* layer_name)
      {
      //
      PMAINWIN pWin;
      fprintf(stderr,"CreateMainWindowEx run zth\n");

      if (pCreateInfo == NULL) {
      
          return HWND_INVALID;
      }
      
      if (!(pWin = calloc(1, sizeof(MAINWIN)))) {
      
          return HWND_INVALID;
      }
      fprintf(stderr,"CreateMainWindowEx	run111 zth\n");
      

      #ifdef _MGRM_THREADS
      fprintf(stderr,"CreateMainWindowEx run 11\n");

      if (pCreateInfo->hHosting == HWND_DESKTOP || pCreateInfo->hHosting == 0) {
          /*
           ** Create thread infomation and message queue for this new main window.
           */
          if ((pWin->pMessages = GetMsgQueueThisThread ()) == NULL) {
              if (!(pWin->pMessages = mg_InitMsgQueueThisThread ()) ) {
                  free (pWin);
      
                  return HWND_INVALID;
              }
              pWin->pMessages->pRootMainWin = pWin;
          }
          else {
              /* Already have a top level main window, in case of user have set 
                 a wrong hosting window */
              pWin->pHosting = pWin->pMessages->pRootMainWin;
          }
      }
      else {
          pWin->pMessages = GetMsgQueueThisThread ();
          if (pWin->pMessages != kernel_GetMsgQueue (pCreateInfo->hHosting) ||
                  pWin->pMessages == NULL) {
              free (pWin);
      
              return HWND_INVALID;
          }
      }
      fprintf(stderr,"CreateMainWindowEx  run 22");
      
      if (pWin->pHosting == NULL)
          pWin->pHosting = gui_GetMainWindowPtrOfControl (pCreateInfo->hHosting);
      /* leave the pHosting is NULL for the first window of this thread. */
      

      #else
      fprintf(stderr,"CreateMainWindowEx runzth 11\n");

      pWin->pHosting = gui_GetMainWindowPtrOfControl (pCreateInfo->hHosting);
      if (pWin->pHosting == NULL)
          pWin->pHosting = __mg_dsk_win;
      

      报错信息:
      dbg line[80 ] sample_philips_recorder.c CreateMainWindow
      CreateMainWindowEx run zth
      CreateMainWindowEx run111 zth
      CreateMainWindowEx run 11
      Segmentation fault (core dumped)

      求教原因!!!!

      发布在 其它全志芯片讨论区
      Z
      zhangtanghua