National Instruments Drums 320685D-01 ユーザーズマニュアル

ページ / 211
Chapter 1
LabWindows/CVI Compiler
©
 National Instruments Corporation
1-5
LabWindows/CVI Programmer Reference Manual
You can set the maximum alignment as follows:
#pragma pack(4) /* sets maximum alignment to 4 bytes */
#pragma pack(8) /* sets maximum alignment to 8 bytes */
#pragma pack()  /* resets to the default*/
The maximum alignment the compiler applies to a structure is based on the last 
pack 
pragma
 statement it sees before the definition of the structure.
Program Entry Points (Windows 95/NT Only)
Under Windows 95/NT, you can use 
WinMain
 instead of 
main
 as the entry-point function to 
your program. You might want to do this if you plan to link your executable using an external 
compiler. You must include 
windows.h
 for the data types that normally appear in the 
WinMain
 parameter list. The following is the prototype for 
WinMain
 with the Windows data 
types reduced to intrinsic C types.
int __stdcall
 
WinMain(void *
 
hInstance, void *
 
hPrevInstance, 
char *
 
lpszCmdLine int nCmdShow)
C Library Issues 
This section discusses special considerations in LabWindows/CVI in the areas of low-level 
I/O functions and the UNIX C library.
Using the Low-Level I/O Functions 
Many functions in the UNIX libraries and the C compiler libraries for the PC are not ANSI C 
Standard Library functions. In general, LabWindows/CVI implements the ANSI C Standard 
Library. Under UNIX, you can call UNIX libraries for the non-ANSI C functions in 
conjunction with LabWindows/CVI.
The low-level I/O functions 
open
close
read
write
lseek
, and 
eof
 are not in the 
ANSI C Standard Library. Under UNIX, these functions are available in the UNIX C library. 
Refer to Chapter 5, 
, for more information.
Under Windows, you can use these functions along with 
sopen
 and 
fdopen
 if you include 
lowlvlio.h
00ProRef.book : 06chap01.fm  Page 5  Monday, March 9, 1998  3:23 PM