win32常用函数-1
2012-03-22 21:23
239 查看
InitializeCriticalSection
The InitializeCriticalSection function initializes a critical section object.
VOID InitializeCriticalSection(
LPCRITICAL_SECTION lpCriticalSection // address of critical section object
);
Parameters
lpCriticalSection
Points to the critical section object.
Return Values
This function does not return a value.
Remarks
The threads of a single process can use a critical section object for mutual-exclusion synchronization. The process is responsible for allocating the memory used by a critical section object, which it can
do by declaring a variable of type CRITICAL_SECTION. Before using a critical section, some thread of the process must call the InitializeCriticalSection function to initialize the object.
Once a critical section object has been initialized, the threads of the process can specify the object in the EnterCriticalSection, TryEnterCriticalSection, or LeaveCriticalSection function to provide mutually
exclusive access to a shared resource. For similar synchronization between the threads of different processes, use a mutex object.
A critical section object cannot be moved or copied. The process must also not modify the object, but must treat it as logically opaque. Use only the functions provided in the Win32 application programming
interface (API) to manage critical section objects.
DeleteCriticalSection
The DeleteCriticalSection function releases all resources used by an unowned critical section object.
VOID DeleteCriticalSection(
LPCRITICAL_SECTION lpCriticalSection // pointer to critical section object
);
Parameters
lpCriticalSection
Points to the critical section object.
Return Values
This function does not return a value.
Remarks
Deleting a critical section object releases all system resources used by the object. Once deleted, the critical section object cannot be specified in the EnterCriticalSection, TryEnterCriticalSection, or
LeaveCriticalSection function.
GetLocalTime
The GetLocalTime function retrieves the current local date and time.
VOID GetLocalTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);
Parameters
lpSystemTime
Points to a SYSTEMTIME structure to receive the current local date and time.
Return Values
This function does not return a value.
FreeAndNil
Frees an object reference and replaces the reference with Nil.
procedure FreeAndNil(var Obj);
Parameters
var Obj
Object reference to be freed and Nil'd.
Description
FreeAndNil is a procedure used to free the object reference specified by Obj, and sets the object reference to the Nil value.
Use FreeAndNil to ensure that a variable is Nil after you free the object it references. Pass any variable that represents an object as the Obj parameter.
Note: Do not pass a value for Obj if it is not an instance of TObject or a TObject descendant.
FreeAndNil is a convenience procedure provided for Delphi or C++ Builder products using a VCL version prior to VCL 5
The InitializeCriticalSection function initializes a critical section object.
VOID InitializeCriticalSection(
LPCRITICAL_SECTION lpCriticalSection // address of critical section object
);
Parameters
lpCriticalSection
Points to the critical section object.
Return Values
This function does not return a value.
Remarks
The threads of a single process can use a critical section object for mutual-exclusion synchronization. The process is responsible for allocating the memory used by a critical section object, which it can
do by declaring a variable of type CRITICAL_SECTION. Before using a critical section, some thread of the process must call the InitializeCriticalSection function to initialize the object.
Once a critical section object has been initialized, the threads of the process can specify the object in the EnterCriticalSection, TryEnterCriticalSection, or LeaveCriticalSection function to provide mutually
exclusive access to a shared resource. For similar synchronization between the threads of different processes, use a mutex object.
A critical section object cannot be moved or copied. The process must also not modify the object, but must treat it as logically opaque. Use only the functions provided in the Win32 application programming
interface (API) to manage critical section objects.
DeleteCriticalSection
The DeleteCriticalSection function releases all resources used by an unowned critical section object.
VOID DeleteCriticalSection(
LPCRITICAL_SECTION lpCriticalSection // pointer to critical section object
);
Parameters
lpCriticalSection
Points to the critical section object.
Return Values
This function does not return a value.
Remarks
Deleting a critical section object releases all system resources used by the object. Once deleted, the critical section object cannot be specified in the EnterCriticalSection, TryEnterCriticalSection, or
LeaveCriticalSection function.
GetLocalTime
The GetLocalTime function retrieves the current local date and time.
VOID GetLocalTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);
Parameters
lpSystemTime
Points to a SYSTEMTIME structure to receive the current local date and time.
Return Values
This function does not return a value.
FreeAndNil
Frees an object reference and replaces the reference with Nil.
procedure FreeAndNil(var Obj);
Parameters
var Obj
Object reference to be freed and Nil'd.
Description
FreeAndNil is a procedure used to free the object reference specified by Obj, and sets the object reference to the Nil value.
Use FreeAndNil to ensure that a variable is Nil after you free the object it references. Pass any variable that represents an object as the Obj parameter.
Note: Do not pass a value for Obj if it is not an instance of TObject or a TObject descendant.
FreeAndNil is a convenience procedure provided for Delphi or C++ Builder products using a VCL version prior to VCL 5
相关文章推荐
- 常用的Win32函数清单
- Win32 API 常用函数之三——注册表操作(上)
- win32常用函数
- Win32 API 常用函数之一
- 常用的Win32函数清单
- Win32 API 常用函数之二
- 常用的用来绘制图形的win32GDI函数
- Win32常用函数
- 常用的用来绘制图形的win32GDI函数
- 常用的Win32函数清单
- 常用C库函数与WIN32函数比较一览表
- Oracle常用函数介绍之二(date)
- oracle常用函数归纳
- C++常用库的函数详解
- php 数组,常用函数
- selenium2.0关于python的常用函数
- 常用T-SQL数据库函数整理
- Discuz function_core 常用函数解析
- Win32程序函数调用时堆栈变化情况分析
- 计算机何中常用的函数及一些精度的简单处理