我必须围绕现有的静态C库开始开发C ++ / CLI Wrapper。我在C库中遇到了许多枚举,typedef和结构。由于我是C ++ / CLI的新手,我想知道C ++ / CLI中可以使用哪种数据类型。
typedef struct _GC_DEVICE {
TCHAR *ptszDevicePath;
/// The human-readable name of the device.
/// This member is never NULL.
TCHAR *ptszFriendlyName;
//Device Type
GC_DEVICE_TYPE DeviceType;
/// USB related information about the camera.
GC_USB_DEVICE_INFO USBDevInfo;
} GC_DEVICE,*PGC_DEVICE;
enum GC_DEVICE_TYPE {
GC_USB_DEVICE,
GC_IP_DEVICE,
GC_DEPTH_SENSING_DEVICE,
};
typedef struct _GC_USB_DEVICE_INFO {
/// The vendor ID.
WORD wVendor;
/// The product ID.
WORD wProduct;
/// The product revision number.
WORD wRelease;
} GC_USB_DEVICE_INFO, *PGC_USB_DEVICE_INFO;
任何正文可以帮助我在C ++ / CLI中转换这些声明吗?
答案 0 :(得分:0)
ref class GCDeviceWrapper
{
public:
// operations with the GC_DEVICE instance
private:
GC_DEVICE device_;
};