
Converting C structures to VB
Converting C Structures to
Visual Basic I am trying to convert a network program written in C to Visual Basic.
I have a C structure which I have converted to a VB type dec. with no
problems. However, another C structure points to the address of the first
structure as one of its elements, as shown below:
struct Struct1 in VB...
{ type Test1
Dummy integer; Dummy as integer
Dummy1 integer; Dummy1 as integer
Quote:
} endtype
struct Struct2
{ type Test2
Dummy integer Dummy as integer
Pointer &Struct1 Pointer as ????????
Quote:
} endtype
OK I realise that the above code is very poor C (and probably would never compile!)
but I hope it explains what I am trying to achieve in VB.
What type do I declare Pointer as in the VB type dec. It is an address to another
structure (near in C) but I am not sure how to declare it to allow me to load a value
into it with a line such as:
global Temp1 as Test1
global Temp2 as Test2
Temp2.Pointer=Temp1 *** this will not work but it should load the address of
*** Temp1 into Temp2.Pointer
If anyone has any suggestions as to how I may achieve the above, I would be most
grateful to receive them.
Many thanks
Paul Gower