原因:當使用新版本的編譯器進行編譯,偶爾會產生結構化異常信息,那麼在默認情況下,安全結構化異常處理將是打開的,可以使用/SAFESEH:NO命令行選項來關閉安全結構化異常處理。
Thursday, May 20, 2010
[RTX] LINK : error LNK2001: 無法解析的外部符號 __load_config_used
原因:當使用新版本的編譯器進行編譯,偶爾會產生結構化異常信息,那麼在默認情況下,安全結構化異常處理將是打開的,可以使用/SAFESEH:NO命令行選項來關閉安全結構化異常處理。
Wednesday, May 19, 2010
[研究]要怎麼證明一個東西錯了呢?
[C++][引用] Interpreting HRESULT Values
In the Microsoft® Windows® operating system, error codes are returned as signed 32-bit HRESULT values that indicate the status of an operation. The high-order sign bit indicates success or failure of the particular method function call.
Interpreting HRESULTs
The HRESULT data type is composed of fields depicted by the following diagram:
The 32-bit value is used to describe an error or warning and is composed of a 1-bit code that indicates the severity (S) of the condition; 0 for success and 1 for failure. The severity code is followed by 4 reserved bits depicted as R, C, N, and r, and then by an 11-bit facility code that indicates responsibility for the error or warning that is defined in the method implementation.
The Facility codes and Error codes are defined by the Winerror.h header file. The following table lists some typical HRESULT values:
Return value/code | Description |
---|---|
0x00000000 | Operation successful |
0x80004001 | Not implemented |
0x80004002 | Interface not supported |
0x80004004 | Operation aborted |
0x80004005 | Unspecified failure |
0x80070057 | One or more arguments are invalid |
For more information about HRESULT, Facility Codes (Codes in FACILITY_ITF), and mapping Win32 error values (HRESULT_FROM_WIN32) into an HRESULT, see Microsoft Developer Network (MSDN).
Note Because error codes are implementation specific, two identical HRESULTs that are returned from two different interfaces can have different meanings.
[C][引用]printf( ) 的列印格式、控制字元、修飾子
列印格式- | -輸出敘述 |
%c | -字元 |
%s | -字串 |
%d | -十進位整數 |
%u | -無號十進位整數 |
%o | -無號八進位整數 |
%x | -無號十六進位整數,以 0 ~ f 表示 |
%X | -無號十六進位整數,以 0 ~ F 表示-- |
%f | -浮點數,小數點型式 |
%e | -浮點數,指數e型式 |
%E | -浮點數,指數E型式 |
%g | -印出 %f 與 %e 較短者 |
%G | -印出 %F 與 %E 較短者 |
%p | -指標位址 |
%% | -印出百分比符號 |
-
-控制字元-- | -功能 |
\a | -警告音 |
\b | -倒退 |
\f | -換頁 |
\n | -換行 |
\r | -歸位 |
\t | -跳格 |
\’ | -印出單引號 |
\』 | -印出雙引號 |
\\ | -反斜線 |
\/ | -斜線 |
\d | -八進位 Ascii 碼 |
\x | -十六進位 Ascii 碼-- |
修飾子- | -功能 | -範例 |
- | -向左對齊 | -%-3d |
+ | -將數值的正負號顯示出來 | -%+5d |
空白 | -數值為正值時,留一格空白;為負值時,顯示負號 | -% 6f |
0 | -將固定欄位長度的數值前空白處填上 0;與 – 修飾子同時使用時,此修飾子無效-- | -%07.2f-- |
數字 | -欄位長度,當數值的位數大於所定的欄位長度時,欄位會自動加寬它的長度 | -%9d |
. | -數值以 %e, %E, %f 型式表示時,決定小數點後所要顯示的位數 | -%4.3f |
h | -表示 short int 或是 unsigned short int | -%5h |
l | -表示 long int 或是 unsigned long int | -%lu |