getNamedNumberOrDefault method
Implementation
double getNamedNumberOrDefault(String name, double defaultValue) {
final retValuePtr = calloc<Double>();
final nameHstring = convertToHString(name);
try {
final hr = ptr.ref.vtable
.elementAt(10)
.cast<
Pointer<
NativeFunction<
HRESULT Function(Pointer, IntPtr name,
Double defaultValue, Pointer<Double>)>>>()
.value
.asFunction<
int Function(Pointer, int name, double defaultValue,
Pointer<Double>)>()(
ptr.ref.lpVtbl, nameHstring, defaultValue, retValuePtr);
if (FAILED(hr)) throw WindowsException(hr);
final retValue = retValuePtr.value;
return retValue;
} finally {
WindowsDeleteString(nameHstring);
free(retValuePtr);
}
}