請問各位先知........一個.hex檔的轉碼方式 |
尚未結案
|
kevinhue
一般會員 ![]() ![]() 發表:23 回覆:42 積分:13 註冊:2003-05-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
frederick
中階會員 ![]() ![]() ![]() 發表:101 回覆:108 積分:66 註冊:2002-08-01 發送簡訊給我 |
引言: 請問一下,電腦程式裡的.hex檔編碼方式是怎麼編的ㄚ??? 因為我想要寫一個hex檔轉bin檔....... kevinhue |
kevinhue
一般會員 ![]() ![]() 發表:23 回覆:42 積分:13 註冊:2003-05-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
|
kevinhue
一般會員 ![]() ![]() 發表:23 回覆:42 積分:13 註冊:2003-05-06 發送簡訊給我 |
|
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
kevinhue您好:
假如這FUNCTION是您要的話,那再看看MSDN的說明,看看有沒有幫助
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi/html/_mapi1book_fbinfromhex.asp 順心
|
turboted
版主 ![]() ![]() ![]() ![]() ![]() 發表:95 回覆:754 積分:452 註冊:2002-07-23 發送簡訊給我 |
BCB可以直接用,但HELP ON-LINE 查不到
你要在CODE裏面直接輸入
HexToBin( 就會出現參數說明
function HexToBin(Text, Buffer: PChar; BufSize: Integer): Integer delphi 使用 HexToBin BinToHex 互轉
原文出處
http://www.blong.com/Conferences/DCon99/VCLSourcery/VCLSourcery.htm
Listing 8: Using BinToHex and HexToBin //Buffer is binary data, //Text is target text buffer (assumed to be big enough), //BufSize is size of binary data block //procedure BinToHex(Buffer, Text: PChar; BufSize: Integer); //Text is textual representation of binary data, //Buffer is target binary data buffer //BufSize is size of textual data buffer //function HexToBin(Text, Buffer: PChar; BufSize: Integer): Integer; procedure TForm1.Button1Click(Sender: TObject); var E: Extended; //Make sure there is room for null terminator Buf: array[0..SizeOf(Extended) * 2] of Char; begin E := Pi; Label1.Caption := Format('E starts off as %.15f', [E]); BinToHex(@E, Buf, SizeOf(E)); //Slot in the null terminator for the PChar, so we can display it easily Buf[SizeOf(Buf) - 1] := #0; Label2.Caption := Format('As text, the binary contents of E look like %s', [Buf]); //Translate just the characters, not the null terminator HexToBin(Buf, @E, SizeOf(Buf) - 1); Label3.Caption := Format('Back from text to binary, E is now %.15f', [E]); end; |
taishyang
站務副站長 ![]() ![]() ![]() ![]() ![]() ![]() 發表:377 回覆:5490 積分:4563 註冊:2002-10-08 發送簡訊給我 |
我補充C++的範例
http://www.expertsexchange.com/Programming/Programming_Languages/Cplusplus/Q_20169213.html 順心
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |