首页
社区
课程
招聘
[求助][分享]API编程非MFC
发表于: 2007-9-9 20:52 11896

[求助][分享]API编程非MFC

2007-9-9 20:52
11896
//用过MFC的朋友都知道RC资源文件的功能。
//
//小弟今天遇到了问题以下代码编译成功。但是我希望执行文件用自定义的ICO图标。
//
//附源码
#include <windows.h>  

LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wparam, LPARAM lparam);

int WINAPI WinMain(HINSTANCE hinstance,
     HINSTANCE hprevinstance,LPSTR lpcmdline,int ncmdshow)
{

WNDCLASSEX winclass = {0};
    HWND hwnd;  
    MSG  msg;   

winclass.cbSize = sizeof(WNDCLASSEX);
winclass.style = CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.hInstance = hinstance;
winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
winclass.lpszClassName = "WinInit";
winclass.hCursor=LoadCursor(NULL,IDC_CROSS);
winclass.hIcon = LoadIcon(NULL,MAKEINTRESOURCE(32651));
RegisterClassEx(&winclass);

hwnd = CreateWindowEx(NULL, "WinInit", "First Window",  
       WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0,
       200, 200, NULL, NULL, hinstance, NULL);
ShowWindow (hwnd,SW_SHOWMAXIMIZED);
UpdateWindow (hwnd);
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}

LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wparam, LPARAM lparam)
{
switch (msg)                  /* handle the messages */
    {
                  case WM_CLOSE:
           DestroyWindow( hwnd );
           return 0;

      case WM_DESTROY:
           PostQuitMessage (0);
           return 0;
break;
      default:                   /* for messages that we don't deal with */
      return DefWindowProc(hwnd,msg,wparam,lparam);
    }
    return 0;
}

[课程]FART 脱壳王!加量不加价!FART作者讲授!

收藏
免费 0
支持
分享
最新回复 (19)
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
2
没人回答吗!沙发自己坐
2007-9-9 21:32
0
雪    币: 398
活跃值: (343)
能力值: (RANK:650 )
在线值:
发帖
回帖
粉丝
3
自己导入一个你要的icon资源 ,比如ID是ID_ICON
在消息循环中
加入
                        case WM_CREATE:
                        SendMessage(hwnd, WM_SETICON, 1, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)));
                        return 0;
2007-9-9 21:33
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
4
不是的我的意思是编译后的执行文件图标。因为我以上的代码编译后的执行文件不可以显示ICO图标.
2007-9-9 21:58
0
雪    币: 398
活跃值: (343)
能力值: (RANK:650 )
在线值:
发帖
回帖
粉丝
5
如果你照我说的做了,你就能看到ico图标了
可惜你没有
2007-9-10 08:50
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
6
LRESULT CALLBACK WindowProc(HWND hwnd,UINT msg,WPARAM wparam, LPARAM lparam)
{
switch (msg)                  /* handle the messages */
    {
case WM_CREATE:          /*这里是按照你给的代码加进来的编译后还是不行我用的是BCC55编译器*/
      SendMessage(hwnd, WM_SETICON, 1, (LPARAM)LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)));
      return 0;
            case WM_CLOSE:
           DestroyWindow( hwnd );
           return 0;

      case WM_DESTROY:
           PostQuitMessage (0);
           return 0;
break;
      default:                   /* for messages that we don't deal with */
      return DefWindowProc(hwnd,msg,wparam,lparam);
    }
    return 0;
}
2007-9-10 09:04
0
雪    币: 2384
活跃值: (766)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
7
只要在Rc资源文件里定义和引入一个ICON图标资源,系统自动取第一个ICON为程序的默认图标。
2007-9-10 09:32
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
8
问题是BCC55不像VC或DEV。。。
我希望解决的是不用在RC资源文件的基础上就可以实现
2007-9-10 09:59
0
雪    币: 2384
活跃值: (766)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
9
不用RC资源似乎不可能。不过BC++应该也可像VC那样自定义资源文件的。
2007-9-10 10:53
0
雪    币: 224
活跃值: (147)
能力值: ( LV9,RANK:970 )
在线值:
发帖
回帖
粉丝
10
winclass.hIcon = LoadIcon(hinstance, IDI_ICON);
2007-9-10 11:26
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
11
这个不会改变执行文件的图标。试过了只能修改窗口句柄上的图标
2007-9-10 12:08
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
12
Borland C++ Builder Compiler这个编译嚣我也搞不明白怎么加入自定义的RC文件。要是能加入那也就什么问题也没有了。
2007-9-10 12:11
0
雪    币: 2384
活跃值: (766)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
13
我没有BC++,只有Delphi,不过BC++和Delphi是一个公司的,操作应该差不多。如果你用BC++编译器,试试在选项里看看有没有修选ICON图标的功能,Delphi选项里是有这个功能的。
2007-9-10 12:20
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
14
哦你说的是C++Builder 而我用的不是它。我用的是Borland C++ Builder Compiler 5.5无可视化编程界面。也没有你所说的选项编译的时候只有用命令比如 >bcc32 -tW main.c 。
2007-9-10 12:31
0
雪    币: 224
活跃值: (147)
能力值: ( LV9,RANK:970 )
在线值:
发帖
回帖
粉丝
15
没装BC++编译器,记不清楚
Delphi里可以这样修改
Project--Option--Application--Icon

自己找找吧
BC++和Delphi编译器结构区别不大
2007-9-10 12:43
0
雪    币: 211
活跃值: (21)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
16
你们再说什么`怎么看不懂````````
2007-9-10 12:47
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
17
Borland C++ Builder Compiler 5.5没有可视化的环境也没有什么

Project--Option--Application--Icon
2007-9-10 13:27
0
雪    币: 2384
活跃值: (766)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
18
刚才在网上看了一下,BCB++5.5的确有一个简版,没带有可视化IDE。下载看了一下。你可以使用下面的操作:
    先建立一个Rc资源,里面包含ICON图标资源。然后用brcc32.exe生成*.res文件,接着用bcc32.exe -W -c *.obj命令生成*.obj文件。最后用ilink32.exe -v *.obj  import32.lib cw32.lib c0w32.obj /aa,,,,,*.res命令链接资源文件便可。
(注:其中的*.obj和*.res是你自己的源文件生成的Obj和Res文件)
2007-9-10 18:06
0
雪    币: 2384
活跃值: (766)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
19
注意,/aa后面有5个','逗号不能多也不能少。前面的五个','是其他参数,可以省略的,链接资源文件参数在第六位,所以*.res必须在5个','逗号后面,
2007-9-10 18:11
0
雪    币: 161
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
PFC
20
虾工你说的很对啊。我刚好下午也找到了这个解决方法。没想到找来找去还不如去看安装文件目录下的HELP文件。照HLEP里面的做法编译成功。

附上 HELP文件说明的注解。

//--------BRC用法
BRCC32 is the command-line version of the resource compiler. It accepts a resource script file (.RC) as input and produces a resource object file (.RES) as output.

Syntax

BRCC32 [options] <filename>.RC

Command-line options

BRCC32 accepts these options:

Option        Description

@responsefile        Takes instructions from the specified command file.
-c <code page>        Uses the specified code page for resource translation. If -c is not used, the default ANSI code page is used.
-d<name>[=<string>]        Defines a preprocessor symbol.
-fo<filename>        Renames the output .RES file. (By default, BRCC32 creates the output .RES file with the same name as the input .RC file.)
-i<path>        Adds one or more directories (separated by semicolons) to the include search path.

-l<language>        Specifies default language.
-m        Indicates that the code page specified with the -c switch contains double-byte character set (DBCS) characters.
-r        This switch is ignored. It is included for compatibility with other resource compilers.
-v        Prints progress messages (verbose).
-x        Deletes the current include path.
-? or -h        Displays help.
-16        Builds a 16-bit resource.
-32        Builds a 32-bit resource.

BRCC32 predefines common resource-related Windows constants such as WS_VISIBLE and BS_PUSHBUTTON. Also, two special compiler-related symbols are defined: RC_INVOKED and WORKSHOP_INVOKED. These symbols can be used in the source text in conjunction with conditional preprocessor statements to control compilation. For example, the following construct can greatly speed up compilation:

#ifndef WORKSHOP_INVOKED

#include "windows.h"

#endif

Downward compatibility

The following syntax and options are supported for downward compatibility:

Syntax

BRCC32 [options] <filename>.RC

Command-line options

BRCC32 accepts these options:

Option        Description

-31        Builds Windows 3.1-compatible .RES files.
-w32        Builds Win32-compatible .RES files.
//-----------------------------------------------------------------------BCC32编译执行文件
The following table is an alphabetical listing of the C++Builder compiler options:

Option        Description

@<filename>        Read compiler options from the response file filename
+<filename>        Use alternate compiler configuration file filename
-3        Generate 80386 protected-mode compatible instructions (Default)
-4        Generate 80386/80486 protected-mode compatible instructions
-5        Generate Pentium instructions
-6        Generate Pentium Pro instructions

-A        Use ANSI keywords and extensions
-AK        Use Kernighan and Ritchie keywords and extensions
-AT        Use Borland C++ keywords and extensions (also -A-)
-AU        Use UNIX V keywords and extensions
-a        Default (-a4) data alignment; -a- is byte alignment (-a1)
-an        Align data on "n" boundaries, where 1=byte, 2=word (2 bytes), 4=double word (4 bytes), 8=quad word (8 bytes), 16=paragraph (16 bytes) (Default: -a4)

-B        Compile to .ASM (-S), then assemble to .OBJ
-b        Make enums always integer-sized (Default: -b makes enums integer size)
-b-        Makes enums byte-sized when possible
-C        Turn nested comments on (Default: -C- turn nested comments off)
-CP        Enable code paging (for MBCS)
-c        Compile to .OBJ, no link
-D<name>        Define "name" to the null string
-D<name=string>        Define "name" to "string"

-d        Merge duplicate strings
-d-        Does not merge duplicate strings (Default)
-E<filename>        Specify assembler
-e<filename>        Specify executable file name
-f        Emulate floating point
-f-        No floating point
-ff        Fast floating point
-fp        Correct Pentium FDIV flaw
-gb        Stop batch compilation after first file with warnings (Default = OFF)
-gn        Warnings: stop after n messages (Default = 255)

-G, -G-        Optimize for size/speed; use ?O1 and 朞2 instead
-H        Generate and use precompiled headers
-H-        Does not generate or use precompiled headers (Default)
-H=<filename>        Set the name of the file for precompiled headers
-H"xxx"        Stop precompiling after header file xxx
-Hc        Cache precompiled header (Must be used with -H or -H"xxx"
-He        Enable precompiled headers with external type files (Default)

-Hh=xxx        Stop precompiling after header file xxx
-Hs        Enable smart cached precompiled headers (Default)
-Hu        Use but do not generate precompiled headers
-I<path>        Include file search path
-in        Make significant identifier length to be n (Default = 250)
-Ja        Expand all template members (including unused members)
-jb        Stop batch compilation after first file with errors (Default = OFF)

-Jgd        Generate definitions for all template instances and merge duplicates (Default)
-Jgx        Generate external references for all template instances
-jn        Errors: stop after n messages (Default = 25)
-K        Default character type unsigned (Default: -K- default character type signed)
-k        Turn on standard stack frame (Default)
-L<path>        Library file search path
-lx        Pass option x to linker

-l-x        Disables option x for the linker
-M        Create a Map file
-n<path>        Sets output directory to path
-O        Optimize jumps
-O1        Generate smallest possible code
-O2        Generate fastest possible code
-Oc        Eliminate duplicate expressions within basic blocks and functions
-Od        Disable all optimizations
-Oi        Expand common intrinsic functions

-OS        Pentium instruction scheduling
-O-S        Disables instruction scheduling
-Og        Optimize for speed; use 朞2 instead
-Os        Optimize for speed; use 朞2 instead
-Ot        Optimize for size; use 朞1 instead
-Ov        Enable loop induction variable and strength reduction
-Ox        Optimize for speed; use 朞2 instead
-o<filename>        Compile .OBJ to filename

-P        Perform C++ compile regardless of source extension
-P-        Perform C++ compile depending on source file extension
-P<ext>        Perform C++ compile, set output to extension to .ext
-p        Use Pascal calling convention
-p-        Use C calling convention
-pc        Use C calling convention (Default: -pc, -p-)
-pm        Functions without an explicit calling convention to use __msfastcall.

-pr        Use fastcall calling convention for passing parameters in registers
-ps        Use stdcall calling convention
-Q        Extended compiler error information(Default = OFF)
-q        Suppress compiler identification banner (Default = OFF)
-R        Include browser information in generated .OBJ files
-RT        Enable runtime type information (Default)
-r        Use register variables (Default)
-r-        Disable the use of register variables

-rd        Use register variables only when register keyword is employed
-S        Compile to assembler
-T-        Removes all assembler options
-Tx        Specify assembler option x
-tW        Target is a Windows application (same as -W)
-tWC        Target is a console application (same as -WC)
-tWD        Generate a .DLL executable (same as -WD)
-tWM        Generate a 32-bit multi-threaded target (same as -WM)

-tWR        Target uses the dynamic RTL (same as -WR)
-tWV        Target uses the VCL
-U<name>        Undefine any previous definitions of name
-u        Generate underscores (Default)
-V        Use smart C++ virtual tables (Default)
-V0        External C++ virtual tables
-V1        Public C++ virtual tables
-VC        Calling convention mangling compatibility
-Vd        for loop variable scoping

-Ve        Zero-length empty base classes
-VM        Microsoft Visual C++ compatibility
-VI-        Use old Borland search algorithm to locate header files (look first in current working directory)
-Vl        Use old-style Borland C++ structure layout (for compatibility with older versions of BCC32.EXE)
-VF        MFC compatibility
-Vmd        Use the smallest possible representation for member pointers
-Vmm        Support multiple inheritance for member pointers

-Vmp        Honor declared precision of member pointers
-Vms        Support single inheritance for member pointers
-Vmv        Place no restrictions on where member pointers can point (Default)
-Vx        Zero-length empty class member functions
-v        Turn on source debugging
-vG        All Codeguard options on
-vGc        Inline pointer access (Codeguard)

-vGd        Global and stack data accesses (Codeguard)
-vGt        this pointer on member function entry (Codeguard)
-vi        Control expansion of inline functions
-W        Target is a Windows application (same as -tW)
-WC        Target is a console application (same as -tWC)
-WD        Generate a .DLL executable (same as -tWD)
-WM        Generate a 32-bit multi-threaded target (same as -tWM)

-WR        Target uses the dynamic RTL (same as -tWR)
-WU        Generates Unicode application
-w        Display warnings on
-w!        Returns non-zero from compiler on warnings
-wxxx        Enable xxx warning message
-w-xxx        Disable xxx warning message
-wmsg        User-defined warnings
-X        Disable compiler autodependency output (Default: -X- use compiler autodependency output)

-x        Enable exception handling (Default)
-xd        Enable destructor cleanup (Default)
-xdg        Use global destructor count (for compatibility with older versions of BCC32.EXE)
-xf        Enable fast exception prologs
-xp        Enable exception location information
-xs        Enable slow exception epilogues
-y        Debug line numbers on

Message options (alphabetical listing)

Option        Number (Alias)        Warning Message

-w-ali        -w-8086        Incorrect use of #pragma alias 揳liasName?= 搒ubstitutename?(Default ON)
-wamb        -w8000        Ambiguous operators need parentheses (Default OFF)
-wamp        -w8001        Superfluous & with function (Default OFF)
-w-asc        -w-8002        Restarting compile using assembly (Default ON)
-wasm        -w8003        Unknown assembler instruction (Default OFF)
-w-aus        -w-8004        'identifier' is assigned a value that is never used (Default ON)

-wbbf        -w8005        Bit fields must be signed or unsigned int (Default OFF)
-w-bei        -w-8006        Initializing 'identifier' with 'identifier' (Default ON)
-w-big        -w-8007        Hexadecimal value contains more than three digits (Default ON)
-w-ccc        -w-8008        Condition is always true OR Condition is always false (Default ON)
-wcln        -w8009        Constant is long (Default OFF)
-w-cod        -w-8093        Incorrect use of #pragma codeseg (Default ON)

-w-com        -w-8010        Continuation character \ found in // comment (Default ON)
-w-cpt        -w-8011        Nonportable pointer comparison (Default ON)
-w-csu        -w-8012        Comparing signed and unsigned values (Default ON)
-wdef        -w8013        Possible use of 'identifier' before definition (Default OFF)
-w-dig        -w-8014        Declaration ignored (Default ON)
-w-dpu        -w-8015        Declare 'type' prior to use in prototype (Default ON)

-w-dsz        -w-8016        Array size for 'delete' ignored (Default ON)
-w-dup        -w-8017        Redefinition of 'macro' is not identical (Default ON)
-w-eas        -w-8018        Assigning 憈ype?to 慹num? (Default ON)
-w-eff        -w-8019        Code has no effect (Default ON)
-w-ext        -w-8020        'identifier' is declared as both external and static (Default ON)
-w-hch        -w-8021        Handler for 'type1' Hidden by Previous Handler for 'type2' (Default ON)

-w-hid        -w-8022        'function1' hides virtual function 'function2' (Default ON)
-w-ias        -w-8023        Array variable 'identifier' is near (Default ON)
-w-ibc        -w-8024        Base class 'class1' is also a base class of 'class2' (Default ON)
-w-ifr        -w-8085        Function 'function' redefined as non-inline (Default ON)
-w-ill        -w-8025        Ill-formed pragma (Default ON)
-w-inl        -w-8026        Functions containing certain constructs are not expanded inline (Default ON)

-w-inl        -w-8027        Functions containing reserved words are not expanded inline (Default ON)
-w-lin        -w-8028        Temporary used to initialize 'identifier' (Default ON)
-w-lvc        -w-8029        Temporary used for parameter 'parameter' (Default ON)
-w-lvc        -w-8030        Temporary used for parameter 'parameter' in call to 'function' (Default ON)
-w-lvc        -w-8031        Temporary used for parameter number (Default ON)

-w-lvc        -w-8032        Temporary used for parameter number in call to 'function' (Default ON)
-w-mcs        -w-8096        Incorrect use of #pragma code_seg (Default ON)
-w-mes        -w-8095        Incorrect use of #pragma message (Default ON)
-w-mpc        -w-8033        Conversion to 憈ype?fails for members of virtual base 慴ase?(Default ON)
-w-mpd        -w-8034        Maximum precision used for member pointer type 憈ype?(Default ON)

-w-msg        -w-8035        User-defined warnings (Default ON)
-wnak        -w8036        Non-ANSI Keyword Used: 'keyword' (Default OFF)
(Note: Use of this option is required for ANSI conformance)
-w-ncf        -w-8037        Non-const function 慺unction?called for const object (Default ON)
-w-nci        -w-8038        Constant member 'identifier' is not initialized (Default ON)
-w-ncl        -w-8039        Constructor initializer list ignored (Default ON)

-w-nfd        -w-8040        Function body ignored (Default ON)
-w-ngu        -w-8041        Negating unsigned value (Default ON)
-w-nin        -w-8042        Initializer for object 'identifier' ignored (Default ON)
-w-nma        -w-8043        Macro definition ignored (Default ON)
-w-nmu        -w-8044        #undef directive ignored (Default ON)
-wnod        -w8045        No declaration for function 'function' (Default OFF)
-w-nop        -w-8046        Pragma option pop with no matching option push (Default ON)

-w-npp        -w-8083        Pragma pack pop with no matching pack push (Default ON)
-w-nsf        -w-8047        Declaration of static function 'function(...)' ignored (Default ON)
-w-nst        -w-8048        Use qualified name to access nested type 'type' (Default ON)
-w-ntd        -w-8049        Use '> >' for nested templates instead of '>>' (Default ON)
-w-nto        -w-8050        No type OBJ file present. Disabling external types option. (Default ON)

-w-nvf        -w-8051        Non-volatile function 慺unction?called for volatile object (Default ON)
-w-obi        -w-8052        Base initialization without a class name is now obsolete (Default ON)
-w-obs        -w-8053        'identifier' is obsolete (Default ON)
-w-ofp        -w-8054        Style of function definition is now obsolete (Default ON)
-w-onr        -w-8097        Not all options can be restored at this time (Default ON)
-w-osh        -w-8055        Possible overflow in shift operation (Default ON)

-w-ovf        -w-8056        Integer arithmetic overflow (Default ON)
-w-par        -w-8057        Parameter 'parameter' is never used (Default ON)
-w-pch        -w-8058        Cannot create pre-compiled header: 慼eader?(Default ON)
-w-pck        -w-8059        Structure packing size has changed (Default ON)
-w-pcm        -w-8094        Incorrect use of #pragma comment (Default ON)
-w-pia        -w-8060        Possibly incorrect assignment (Default ON)

-wpin        -w8061        Initialization is only partially bracketed (Default OFF)
-w-pow        -w-8062        Previous options and warnings not restored (Default ON)
-w-prc        -w-8084        Suggest parentheses to clarify precedence (Default OFF)
-w-pre        -w-8063        Overloaded prefix operator 'operator' used as a postfix operator (Default ON)
-w-pro        -w-8064        Call to function 'function' with no prototype (Default ON)
-w-pro        -w-8065        Call to function 'function' with no prototype (Default ON)

-w-rch        -w-8066        Unreachable code (Default ON)
-w-ret        -w-8067        Both return and return of a value used (Default ON)
-w-rng        -w-8068        Constant out of range in comparison (Default ON)
-w-rpt        -w-8069        Nonportable pointer conversion (Default ON)
-w-rvl        -w-8070        Function should return a value (Default ON)
-wsig        -w8071        Conversion may lose significant digits (Default OFF)
-w-spa        -w-8072        Suspicious pointer arithmetic (Default ON)

-w-stl        -w-8087        憃perator==?must be publicly visible to be contained by a 憂ame?(Default OFF)
-w-stl        -w-8089        憃perator<?must be publicly visible to be contained by a 憂ame?(Default OFF)
-w-stl        -w-8090        憃perator<?must be publicly visible to be used by a 憂ame?(Default OFF)
-w-stl        -w-8091        憈ype?argument 慳rgument?passed to 慺unction?is a 憈ype?iterator. 憈ype?iterator required (Default OFF)
-w-stl        -w-8092        憈ype?argument 慳rgument?passed to 慺unction?is not an iterator. 憈ype?iterator required (Default OFF)

-wstu        -w8073        Undefined structure 'structure' (Default OFF)
-wstv        -w8074        Structure passed by value (Default OFF)
-w-sus        -w-8075        Suspicious pointer conversion (Default ON)
-w-tai        -w-8076        Template instance 'instance' is already instantiated (Default ON)
-w-tes        -w-8077        Explicitly specializing an explicitly specialized class member makes no sense (Default ON)
-w-thr        -w-8078        Throw expression violates exception specification (Default ON)

-wucp        -w8079        Mixing pointers to different 'char' types (Default OFF)
-wuse        -w8080        'identifier' declared but never used (Default OFF)
-w-voi        -w-8081        void functions may not return a value (Default ON)
-w-zdi        -w-8082        Division by zero (Default ON)

//--------------------------------资源壳与EXE文件的组合

The following statement compiles the .RC file, creates a .RES file, and adds the .RES file to the executable file:

brc32 <filename>.RC [<filename>.EXE]

BRC32 automatically seeks an .EXE file with the same name as the .RC file. You need to specify the .EXE file only if its name is different from that of the .RC file.

The following statement creates a .RES file, but not an .EXE file. If you name an .EXE file in the command line, BRC ignores it:

brc32 -r <filename>.RC

The following statement adds an existing .RES file to an executable file. The .EXE file name is required only if it differs from the .RES file name:

brc32 <filename>.RES [<filename>.EXE]

This example uses BRC32 to build a 16-bit Windows 3.1 compatible .RES file:

brc32 -16 -v3.1 -fo<filename>.RES <filename>.RC

经过上面三种方法的结合后就可生成有资源的EXE文件。

通过这篇文件的发布与各位的沟过学习了不少知道。希望这篇文章对大家有用
2007-9-10 20:00
0
游客
登录 | 注册 方可回帖
返回
//