Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

摘要

Createfile 可用來取得序列連接埠的控制代碼。「 Win32 程式設計人員參考 」 的 「 Createfile 」 項目提及的共用模式必須是 0、 建立參數必須是 OPEN_EXISTING,以及範本必須是 NULL。當您使用 "COM1" 到 "COM9" 作為檔案的名稱時,CreateFile() 成功。不過,訊息

INVALID_HANDLE_VALUE

將會在您使用 "COM10" 或以上時回傳。如果連接埠的名稱是 \\.\COM10,呼叫 Createfile 中指定的序列連接埠的正確方式如下: CreateFile( "\\\\.\\COM10", // address of name of the communications device fdwAccess, // access (read-write) mode 0, // share mode NULL, // address of security descriptor OPEN_EXISTING, // how to create 0, // file attributes NULL // handle of file with attributes to copy ); 附註: 此語法也適用於透過 COM9 的 COM1 連接埠。某些版可讓您選擇的連接埠名稱自己。這個語法適用於這些名稱也中。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×