CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  Windows SDK/API

再求救:关于Borland C++的一个初级问题

楼主liudong1982()2006-03-04 11:12:11 在 C++ Builder / Windows SDK/API 提问

我用的是Borland   C++   5.5.1   for   Win32   Copyright   (c)   1993,   2000   Borland  
  编译时出现了一个错误,Error   E2133:   Unable   to   execute   command   'ilink32.exe'  
  而且之前跳出来windows错误报告,说T"urbo   Incremental   Linker   遇到问题需要关闭。我们对此引起的不便表示抱歉"。  
  我以前编译其他windows文件的时候也出现过类似的错误....  
   
      用g++   -mwindows   Window1.cpp   -o   Window1编译,编译正确,产生Window1应用程序,但是我双击的时候,没反映,没窗口跳出,在任务管理器中有这个进程......  
   
  #define   STRICT  
  #include   <windows.h>  
  #include<windowsx.h>  
  #pragma   warning(disable:4068)  
  #pragma   warning(disable:4100)  
  /*     Make   the   class   name   into   a   global   variable     */  
  static   char   szClassName[   ]   =   "Windows1";  
  static   HWND   MainWindow;  
   
  /*     Declare   Windows   procedure     */  
  LRESULT   CALLBACK   WndProc(HWND   hWindow,   UINT   Message,   WPARAM   wParam,   LPARAM   lParam);  
  BOOL   Register(HINSTANCE   hInst);  
  HWND   Creat(HINSTANCE   hInst,int   nCmdShow);  
   
   
   
  int   PASCAL   WinMain   (HINSTANCE   hInst,  
                                          HINSTANCE   hPrevInstance,  
                                          LPSTR   lpszCmdParam,  
                                          int   nCmdShow)  
   
  {  
           
          MSG   Msg;                         /*   Here   messages   to   the   application   are   saved   */  
          if(!hPrevInstance)  
  if   (!Register(hInst))  
      return   FALSE;  
  //if(!   (hWindow=Create(hInst,nCmdShow)))  
  //return   FALSE;  
          /*   Run   the   message   loop.   It   will   run   until   GetMessage()   returns   0   */  
          while   (GetMessage   (&Msg,   NULL,   0,   0))  
          {  
                  /*   Translate   virtual-key   messages   into   character   messages   */  
                  TranslateMessage(&Msg);  
                  /*   Send   message   to   WindowProcedure   */  
                  DispatchMessage(&Msg);  
          }  
   
          /*   The   program   return-value   is   0   -   The   value   that   PostQuitMessage()   gave   */  
          return   Msg.wParam;  
  }  
   
   
  /*Register   the   Window*/  
  BOOL   Register(HINSTANCE   hInst)  
  {  
  WNDCLASS   WndClass;                 /*   Data   structure   for   the   windowclass   */  
   
          /*   The   Window   structure   */  
          WndClass.hInstance   =   hInst;  
          WndClass.lpszClassName   =   szClassName;  
          WndClass.lpfnWndProc   =WndProc;             /*   This   function   is   called   by   windows   */  
          WndClass.style   =CS_HREDRAW|CS_VREDRAW;                                  
  //         WndClass.cbSize   =   sizeof   (WNDCLASS);  
   
          /*   Use   default   icon   and   mouse-pointer   */  
          WndClass.hIcon   =   LoadIcon   (NULL,   IDI_APPLICATION);  
        //WndClass.hIconSm   =   LoadIcon   (NULL,   IDI_APPLICATION);  
          WndClass.hCursor   =   LoadCursor   (NULL,   IDC_ARROW);  
          WndClass.lpszMenuName   =   NULL;                                   /*   No   menu   */  
          WndClass.cbClsExtra   =   0;                                             /*   No   extra   bytes   after   the   window   class   */  
          WndClass.cbWndExtra   =   0;                                             /*   structure   or   the   window   instance   */  
          /*   Use   Windows's   default   color   as   the   background   of   the   window   */  
        WndClass.hbrBackground   =GetStockBrush(WHITE_BRUSH);  
   
          /*   Register   the   window   class,   and   if   it   fails   quit   the   program   */  
        return   RegisterClass   (&WndClass);  
  }  
   
          /*     create   the   window*/  
      HWND   Creat(HINSTANCE   hInstance,int   nCmdShow)  
    {  
  HWND   hWindow   =   CreateWindow   (  
                        //   0,                                       /*   Extended   possibilites   for   variation   */  
                        szClassName,                   /*   Classname   */  
                        "Windows   App",               /*   Title   Text   */  
                        WS_OVERLAPPEDWINDOW,   /*   default   window   */  
                        CW_USEDEFAULT,               /*   Windows   decides   the   position   */  
                        CW_USEDEFAULT,               /*   where   the   window   ends   up   on   the   screen   */  
                        544,                                   /*   The   programs   width   */  
                        375,                                   /*   and   height   in   pixels   */  
                        HWND_DESKTOP,                 /*   The   window   is   a   child-window   to   desktop   */  
                        NULL,                                 /*   No   menu   */  
                        hInstance,               /*   Program   Instance   handler   */  
                        NULL                                   /*   No   Window   Creation   data   */  
                        );  
   
        if(hWindow==NULL)  
        return   hWindow;  
  /*   Make   the   window   visible   on   the   screen   */  
        ShowWindow   (hWindow,   nCmdShow);  
  UpdateWindow(hWindow);  
  return   hWindow;  
    }  
   
           
  #define   Window1_DefProc   DefWindowProc  
  void   Window1_OnDestroy(HWND   hwnd);  
   
   
   
  /*     This   function   is   called   by   the   Windows   function   DispatchMessage()     */  
  //LRESULT   CALLBACK   WindowProcedure   (HWND   hwnd,   UINT   message,   WPARAM   wParam,   LPARAM   lParam)  
  LRESULT   CALLBACK   WndProc(HWND   hWindow,   UINT   Message,   WPARAM   wParam,   LPARAM   lParam)  
  {  
          switch   (Message)                                     /*   handle   the   messages   */  
        {  
                  HANDLE_MSG(hWindow,WM_DESTROY,Window1_OnDestroy);  
            default:                                             /*   for   messages   that   we   don't   deal   with   */  
                          return   Window1_DefProc(hWindow,   Message,   wParam,   lParam);  
          }  
    }  
     
  #pragma   argsused  
    void   Window1_OnDestroy(HWND   hwnd)  
    {  
            PostQuitMessage(0);  
  }  
   
   
  问题点数:20、回复次数:5Top

1 楼liudong1982()回复于 2006-03-04 11:22:40 得分 0

请问高版本的bcc32,Ilink.exe能在哪下到啊?  
  Top

2 楼liudong1982()回复于 2006-03-04 11:24:31 得分 0

大哥帮帮我啊,我这个问题好久了,刚开始学   windows编程,这个都没编译成功......  
  我的qq:66863707,哪为高手加我,教教我啊.....Top

3 楼dragonhux(dragon(清水))回复于 2006-03-04 15:30:10 得分 0

换vc或者bcb,Borland   C++   5.5.1太早了,而且从BC   3.1以上就不稳定了。  
  你的程序在vc和bcb下面一样是可以编译运行的Top

4 楼alloutoflove(andrew)回复于 2006-03-04 15:43:59 得分 0

不是编译器的问题,是你的代码问题.Top

5 楼alloutoflove(andrew)回复于 2006-03-04 15:45:50 得分 20

//if(!   (hWindow=Create(hInst,nCmdShow)))  
  //return   FALSE;  
   
  你这里都屏蔽掉了,   还怎么出窗口=_=Top

相关问题

  • 再求救:关于Borland C++的一个初级问题
  • 求救:关于Borland C++的一个初级问题
  • c++问题(初级)
  • c++初级问题!
  • C++初级问题
  • C++初级问题!
  • c初级问题
  • C#的初级问题:
  • c++文件初级问题
  • 初级C#好地方!

关键词

  • c++
  • borland
  • hinst
  • hwindow
  • ncmdshow
  • hinstance
  • 错误
  • 问题
  • msg
  • hwnd

得分解答快速导航

  • 帖主:liudong1982
  • alloutoflove

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo