Char type in Xojo


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

  DWORD dbcc_size;
  DWORD dbcc_devicetype;
  DWORD dbcc_reserved;
  GUID  dbcc_classguid;
  TCHAR dbcc_name[1];
DWORD ==> Integer
GUID ==> Byte array
TCHAR ==> ????

Should I using String in here :smiley:


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.