JJONES
asked on
How to use VC structures and pointers in VB
Is there anyway in VB that you can define a String of Data (Buffer) and reference that data using a structure (Type) with a pointer?
VC Example:
struct EntryStruct
{
char szFldName [50];
int nFldNumber;
};
char szBuffer [500];
char szName [100];
EntryStruct* pPtr;
pPtr = (EntryStruct*) szBuffer;
szName = pPtr.szFldName;
VC Example:
struct EntryStruct
{
char szFldName [50];
int nFldNumber;
};
char szBuffer [500];
char szName [100];
EntryStruct* pPtr;
pPtr = (EntryStruct*) szBuffer;
szName = pPtr.szFldName;
You can use RtlMoveMemory API to copy a struct into a buffer directly, I think that will be the furthermost vb can do
Anyway, why are you asking, there might be a better way to achive what you want
Anyway, why are you asking, there might be a better way to achive what you want
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dim strxxx as string * 500
You can access any character in it by using
strxxy=mid(strxxx,position