FormatMessage簡單說明

2021-04-12 18:21:29 字數 421 閱讀 8784

常用引數簡介.

formatmessage(format_message_from_system|format_message_allocate_buffer,

null,lval,null,(lptstr)&hlocal,0,null); 

第乙個引數是標誌,告訴這個formatmessage函式,我想要的特點.

第三個引數是dword(unsigned long)型別

第五個引數是lptstr(這個型別即可用與ansi,也克用與unicode).用來接收與messageid 對應的description.

注意:hlocal是hlocal型別也就是handle型別,需要將他轉換到lptstr.

第六個引數是這個buffer的大小,由於設定了format_message_allocate_buffer那麼他就可以置0了

FormatMessage函式封裝

函式的返回值和錯誤碼對判斷函式的執行結果和失敗原因有重要的價值。每個使用windows api進行c 程式設計的老鐵們都自己封裝過formatmessage這個函式,我用了快一年才想到自己去封裝它以提高便攜性。函式myformatmessage列印函式執行狀態及對應的提示資訊。dword myfor...

FormatMessage通過錯誤碼取出錯誤文字

get the error code dword dwerror getdlgitemint hwnd,idc errorcode,null,false handle hlocal null buffer that gets the error message string get the erro...

Ant Design簡單簡單簡單執行

config 配置檔案 config.js 路由定義檔案 路徑檔案 defaultsettings.js 主題顏色以及標題配置檔案 plugin.config.js 沒怎麼用過的配置檔案 dist 構建專案之後產生的檔案 mock mock資料檔案 用於本地開發使用 node modules 資源檔...