problem in c++ Translation
Hello
I have this code in c++ :
typedef struct{
prWChar DeviceInternalName[512]; /* Internal devicve name
(512 characters) */
prWChar ModelName[32]; /* Camera model name
(32 characters) */
prUInt16 Generation; /* Camera generation number
*/
prUInt32 Reserved1; /* Reserved */
prUInt32 ModelID; /* Camera model ID */
prUInt16 Reserved2; /* Reserved */
prPorttype PortType; /* Port type 0x01??FWIA
/ 0x02??FSTI */
prUInt32 Reserved3; /* Reserved */
}prDeviceInfoTable;
typedef struct{
prUInt32 NumList; /* Number of camera device
information included in this structure */
prDeviceInfoTable DeviceInfo[prANY]; /* Camera device information */
}prDeviceList;
prCAPI PR_CreateCameraObject(
prDeviceInfoTable* pDeviceInfo,
prHandle* pCameraHandle
);
prUInt32 BufferSize = 0L;
prDeviceList* pGetDevList = NULL;
BufferSize = (prUInt32)sizeof(prDeviceList) +
(prUInt32)(sizeof(prDeviceInfoTable) * 9L);
pGetDevList = (prDeviceList*)new prUInt8[BufferSize];
PR_GetDeviceList( &BufferSize, (prDeviceList*)pGetDevList );
and need to translate this in vb.net 2005. I do this but have some problem.
my translation is:
Structure prDeviceInfoTable
Dim DeviceInternalName As String
Dim ModelNameas As String
Dim Generation As Integer
Dim Reserved1 As Integer
Dim ModelID As Integer
Dim Reserved2 As Integer
Dim PortType As prPorttype
Dim Reserved3 As Integer
End Structure
Structure prDeviceList
Dim NumList As Integer
Dim DeviceInfo() As prDeviceInfoTable
End Structure
Declare Auto Function prGetDeviceList Lib "PRSDK.dll" Alias
"PR_GetDeviceList" (ByRef pBufferSize As System.UInt32, ByRef pDeviceList As
prDeviceList) As Integer
Dim pBufferSize As System.UInt32
Dim pSourceInfo As New PSReCWrap.prDeviceInfoTable
Dim pDeviceList As PSReCWrap.prDeviceList
pDeviceList = Nothing
pBufferSize = Marshal.SizeOf(pDeviceList) +
(Marshal.SizeOf(pSourceInfo) * 10)
(Line1:) pGetDevList = (prDeviceList*)new prUInt8[BufferSize];
(Line2:) PSReCWrap.prGetDeviceList(pBufferSize, pDeviceList)
I have problem in Line1. are you know what is translated code of this line.
if I delete Line1on this program I get error on Line2. also I am not sure to
define pDeviceList correctly.
Help me Please.
Very thanks.