Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve from_fn and add com_ptr_from_fn macro #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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