Skip to content

Conversation

Osspial
Copy link

@Osspial Osspial commented May 27, 2020

This PR implements the suggestions I made for from_fn in the Rust Community Discord, with some further iterations. Namely:

  • from_fn returns Result<ComPtr<T>, HRESULT> instead of Result<Option<ComPtr<T>>, E>
  • F is redefined as FnOnce(&GUID, &mut *mut P) -> HRESULT

It also adds a com_ptr_from_fn function that generalizes from_fn for COM functions that output multiple COM objects (such as ICallFactory::CreateCall).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant