shwq.net
当前位置:首页 >> DElphi中DWORD是什么数据类型的? >>

DElphi中DWORD是什么数据类型的?

DWORD是32位无符号整型,取值范围0至2的32次方-1,在Delphi中,DWORD,LongInt,Cardinal三种数据类型都一样,都是32位无符号整型(无符号就是没有负的,最小值为0,和之相对的有符号32位整型就是最常用的Integer)

例子程序: program ygb; {$apptype console} //设置程序为非图形界面 uses windows; var x,y:dword; begin x:=$009FBF6E; write('请输入一个DWORD数:'); readln(y); if x=y then writeln('输入正确') else writeln('输入错误'); end. 关健一点...

DWORD在编程时完全和INTEGER一样的用,是一个简单类型,需要在程序头uses windows,否则没有相应的定义。

DWORD相当于unsigned long,是在WinDef头文件中定义的,如下 typedef unsigned long DWORD; 相当于C#中的uint 注意:C#中的long型相当于C++中的long long类型

写注册表用TRegistry更简单.///////////////////////////////////////////这样写试一下看:function RegSetDWord(RootKey: HKEY; SubKey,ValueName,StrDWord: String): Boolean; var iDWord: DWORD; hRegKey: HKEY; begin Result:=not (StrToIntD...

function ReadWord(lpszNodeName, lpszDeviceName: PAnsiChar; lpData: PDWORD; dwCount: DWORD; lpdwReadCount: PDWORD): DWORD;

var n,f : DWORD; a : array [0..31] of Boolean; i : Integer; begin n:=3216461; //DWORD数 f:=1; for i:=0 to 31 do begin //1为True,0为False a[i]:=(n and f)0; f:=f shl 1; end; end;

// 定义函数指针 typedef void __stdcall (*TDVRDownLoadCallback) ( int nDownHandle, TTYL_DVR_DL_Cmd nCmd, DWORD nDataPos, DWORD nDataLen, DWORD dwUserData ); // 回调函数 void __stdcall func ( int nDownHandle, TTYL_DVR_DL_Cmd nCmd...

WSARecv 和 WSASend 函数定义于 WinAPI.Winsock2 单元,其原型定义如下: function WSARecv(s: TSocket; lpBuffers: LPWSABUF; dwBufferCount: DWORD; var lpNumberOfBytesRecvd, lpFlags: DWORD; lpOverlapped: LPWSAOVERLAPPED; lpCompletionR...

unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,registry;type TForm1 = class(TForm) Label1: TLabel; procedure FormCreate(Sender: TObject); private { Private ...

网站首页 | 网站地图
All rights reserved Powered by www.shwq.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com