formatString method
Implementation
String formatString(String number) {
final retValuePtr = calloc<HSTRING>();
final numberHstring = convertToHString(number);
try {
final hr = ptr.ref.vtable
.elementAt(9)
.cast<
Pointer<
NativeFunction<
HRESULT Function(
Pointer, IntPtr number, Pointer<IntPtr>)>>>()
.value
.asFunction<int Function(Pointer, int number, Pointer<IntPtr>)>()(
ptr.ref.lpVtbl, numberHstring, retValuePtr);
if (FAILED(hr)) throw WindowsException(hr);
final retValue = retValuePtr.toDartString();
return retValue;
} finally {
WindowsDeleteString(numberHstring);
WindowsDeleteString(retValuePtr.value);
free(retValuePtr);
}
}