Char type in Xojo

Hi

I’m try to convert this C++ structure to Xojo:

typedef struct _DEV_BROADCAST_DEVICEINTERFACE {
  DWORD dbcc_size;
  DWORD dbcc_devicetype;
  DWORD dbcc_reserved;
  GUID  dbcc_classguid;
  TCHAR dbcc_name[1];
} DEV_BROADCAST_DEVICEINTERFACE, *PDEV_BROADCAST_DEVICEINTERFACE;
DWORD ==> Integer
GUID ==> Byte array
TCHAR ==> ????

Should I using String in here :smiley:

Thanks.

Well, this is not so easy.

TCHAR can be Int8 for ANSI version or Int16 for Unicode version of data structure.
Also this is a variable length buffer which may not be doable in Xojo with structures, so you may need to go with a memoryblock or ptr better.

PS: Everyone using MBS Plugins can simply use WindowsDriveNotificationMBS class for this.