PB_Datatypes for external function arguments

更新时间:2023-07-15 13:26:38 阅读: 评论:0

Datatypes for external function arguments
When you declare an external function in PowerBuilder, the datatypes of the arguments must correspond with the datatypes as declared in the function's source definition. This ction
documents the correspondence between datatypes in external functions and datatypes in墙裂
PowerBuilder. It also includes information on byte alignment when passing structures by value.少先队长
U the tables to find out what PowerBuilder datatype to u in an external function declaration.
The PowerBuilder datatype you lect depends on the datatype in the source code for the function.
The first column lists datatypes in source code. The cond column describes the datatype so you know exactly what it is. The third column lists the PowerBuilder datatype you should u in the external function declaration.
Boolean
BOOL and Boolean on Windows are 16-bit, signed. Both are declared in PowerBuilder as boolean. Pointers
Datatype in source code Size, sign, precision PowerBuilder datatype * (any pointer)32-bit pointer Long
char *Array of bytes of variable length Blob
Windows 32-bit FAR pointers, such as LPBYTE, LPDWORD, LPINT, LPLONG, LPVOID, and LPWORD, are declared in PowerBuilder as long datatypes. HANDLE is defined as 32 bits引人入胜的近义词
unsigned and is declared in PowerBuilder as an UnsignedLong.
Near-pointer datatypes (such as PSTR and NPSTR) are not supported in PowerBuilder. Characters and strings
Datatype in source code Size, sign, precision PowerBuilder datatype char8 bits, signed Char
string32-bit pointer to a null-terminated array of
String
bytes of variable length
干洗行业
The Windows 32-bit FAR pointer LPSTR is declared in PowerBuilder as string.
Reference arguments When you pass a string to an external function by reference, all memory management is done in PowerBuilder. The string variable must be long enough to hold the
returned value. To ensure that this is true, first declare the string variable, and then u the Space function to fill the variable with blanks equal to the maximum number of characters that you expect the function to return.
Fixed-point values抄一篇优秀作文300字
Datatype in source code Size, sign, precision PowerBuilder datatype byte8 bits, unsigned Byte
short16 bits, signed Integer
unsigned short16 bits, unsigned UnsignedInteger什么是机械运动
int 32 bits, signed Long
unsigned int 32 bits, unsigned UnsignedLong
long32 bits, signed Long
unsigned long32 bits, unsigned UnsignedLong
longlong64 bits, signed LongLong
The Windows definition WORD is declared in PowerBuilder as UnsignedInteger and the Windows definition DWORD is declared as an UnsignedLong. You cannot call external functions with return values or arguments of type short.
Floating-point values
Datatype in source code Size, sign, precision PowerBuilder datatype float32 bits, single precision Real
double64 bits, double precision Double镜花水月的意思
PowerBuilder does not support 80-bit doubles on Windows.
Date and time
The PowerBuilder datatypes Date, DateTime, and Time are structures and have no direct
equivalent for external functions in C.
Passing structures by value
感想
You can pass PowerBuilder structures to external C functions if they have the same definitions and alignment as the structure's components. The DLL or shared library must be compiled using byte alignment; no padding is added to align fields within the structure.

本文发布于:2023-07-15 13:26:38,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1082449.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:行业   镜花水月   干洗   意思
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图