Example of Passing Odd-Length String in User-Defined Type to C (69850)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
This article was previously published under Q69850 SUMMARY
The following example demonstrates how to pass a user-defined type
record containing odd-length fixed strings from compiled Basic to
Microsoft C. By default, the C compiler packs structure members on
two-byte boundaries. You must specify the compiler switch /Zp1 to
force the C compiler to pack structure members on one-byte boundaries.
This will prevent errors caused by alignment problems.
This information about inter-language calling applies to QuickBasic
versions 4.00, 4.00b, and 4.50 for MS-DOS; to Microsoft Basic Compiler
versions 6.00 and 6.00b for MS-DOS and MS OS/2; and to Microsoft Basic
Professional Development System version 7.00 and 7.10 for MS-DOS and
MS OS/2.
Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
---|
Keywords: | KB69850 |
---|
|