错误信息为:application terminated
error:specifed argument type differs from required argument type at runtime in dll function openportaa (invalid stack pointer on return from function call)
...全文
10314打赏收藏
pb6.5调用vc++6.0的dll
错误信息为:application terminated error:specifed argument type differs from required argument type at runtime in dll function openportaa (invalid stack pointer on return from function call)
在PB帮助中查"What data type to use"即可查到数据类型转换的对照表:
Pointers
Data type in source code Size, sign, precision PowerBuilder data type
* (any pointer) 32-bit pointer Long
char * Array of bytes of variable length Blob
Platform notes Windows pointers 32-bit FAR pointers such as LPBYTE, LPDWORD, LPINT, LPLONG, LPVOID, and LPWORD are declared in PowerBuilder as long data types. HANDLE is defined as 32 bits unsigned and is declared in PowerBuilder as an UnsignedLong.
Near-pointer data types on Windows (such as PSTR and NPSTR) are not supported in PowerBuilder.
Characters and strings
Data type in source code Size, sign, precision PowerBuilder data type
char 8 bits, signed Char
string 32-bit pointer to a null-terminated array of bytes of variable length String
Platform notes LPSTR in Windows The 32-bit FAR pointer LPSTR is declared in PowerBuilder as string.
Boolean
Platform notes BOOL in Windows BOOL on Windows is 16-bit, signed. It is declared in PowerBuilder as boolean.
Fixed-point values
Data type in source code Size, sign, precision PowerBuilder data type
short 16 bits, signed Integer
unsigned short 16 bits, unsigned UnsignedInteger
int 32 bits, signed Long
unsigned int 32 bits, unsigned UnsignedLong
long 32 bits, signed Long
unsigned long 32 bits, unsigned UnsignedLong
Platform notes WORD and DWORD on Windows The Windows definition WORD is declared in PowerBuilder as UnsignedInteger and the Windows definition DWORD is declared as an UnsignedLong.
Short on 32-bit platforms On 32-bit platforms, you can't call external functions with return values or arguments of type short.
Floating-point values
Data type in source code Size, sign, precision PowerBuilder data type
float 32 bits, single precision Real
double 64 bits, double precision Double
Platform notes Doubles on Windows PowerBuilder does not support 80-bit doubles on Windows.
Date and time
The PowerBuilder data types date, DateTime, and time are structures and have no direct equivalent for external functions in C.
我的参数对照是
vc++编的dll在pb中怎么调用!帮帮忙
bool OpenComm(const char* pPort, int nBaudRate, int nParity, int nByteSize, int nStopBits);
vc里面声明的函数是这样的,在vc里面调用他们写的是
CString strCom="COM";
CString temp="";
pCB->GetWindowText(temp);
strCom+=temp;
if(OpenComm(strCom,CBR_9600,NOPARITY,8, ONESTOPBIT))
pb中我写的是
FUNCTION Boolean OpenComm(REF char pPort, int nBaudRate, int nParity, int nByteSize, int nStopBits) LIBRARY "smspdu.dll"
错误是
错误信息为:application terminated
error:specifed argument type differs from required argument type at runtime in dll function openportaa (invalid stack pointer on return from function call)