-
January 31st, 2001, 07:48 AM
#1
UDT - string length from Variable
I have to call a C DLL. The according header specifies e.g. the following variable:
#define DBCP_FH_LENGTH 80
I made the following of it in the VB Declaration segment.
private DBCP_FH_LENGTH as string * 80
The header reuses this variable in a C structure
typedef struct tagDBCOOP {
... [many stuff]
char FHtext[DBCP_FH_LENGTH];
...
} cDBCOOP;
I translated this to a UDT:
private Type cDBCOOP
....
szFHtext as string * [DBCP_FH_LENGTH]
'Vb want to see a constant expression, next try:
szFHtext as string * DBCP_FH_LENGTH
'same error as the one above
szFHtext as string * (DBCP_FH_LENGTH)
'does not compile.
'is there a way to avoid
szFHtext as string * 80
any help would be appreciated,
Annette
-
January 31st, 2001, 10:59 AM
#2
Re: UDT - string length from Variable
option Explicit
private Const DBCP_FH_LENGTH as Long = 80 ' #define DBCP_FH_LENGTH 80
private szFHtext as string * DBCP_FH_LENGTH
private Sub Form_Click()
MsgBox len(szFHtext)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|