declared initial size of array in structure

G

Guest

Hi
how can I declared initial size of array in structure. I have below code in
c++ and translate this to vb.net. but get this error: "Arrays declared as
structure members cannot be declared with an initial size"

c++:
typedef struct{
prWChar DeviceInternalName[512];
prWChar ModelName[32];
prUInt16 Generation;
}prDeviceInfoTable;

vb.net:
Structure prDeviceInfoTable
Dim DeviceInternalName(0 to 511) As Char
Dim ModelName(0 to 31) As Char
Dim Generation As Integer
End Structure

how can I?
Very thanks
 
H

Herfried K. Wagner [MVP]

Farsad said:
how can I declared initial size of array in structure. I have below code
in
c++ and translate this to vb.net. but get this error: "Arrays declared as
structure members cannot be declared with an initial size"

c++:
typedef struct{
prWChar DeviceInternalName[512];

\\\
Imports System.Runtime.InteropServices
....
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> _
Public DeviceInternalName() As Char
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top