Copy link to clipboard
Copied
Cannot make buffer filled, it is filled with "CD". There is no error returned from ToBinary. Everything passes without error. Other types (StringType, UnicodeStringType...) works without problem.
//...
if (type == BinaryType) {
size_t size;
sAIEntry->AddRef(entry);
sAIEntry->ToBinary(entry, NULL, &size);
void * buffer = malloc(size);
error = sAIEntry->ToBinary(entry, buffer, NULL);
if (!error) {
for (int i = 0; i < size; i++) {
printf("%02x ", ((unsigned char *)buffer));
}
}
}
Have you tried:
error = sAIEntry->ToBinary(entry, buffer, &size);
Not clear from the doc if last argument can be NULL.
Copy link to clipboard
Copied
Have you tried:
error = sAIEntry->ToBinary(entry, buffer, &size);
Not clear from the doc if last argument can be NULL.
Copy link to clipboard
Copied
You are right, it now works. Indeed, there is no NULL mentioned for this argument in documentation, it was just my assumption. Thank You.