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

C++ delegate parameters are already optional #3437

Closed
kennykerr opened this issue Jan 14, 2025 · 1 comment · Fixed by #3452
Closed

C++ delegate parameters are already optional #3437

kennykerr opened this issue Jan 14, 2025 · 1 comment · Fixed by #3452
Labels
bug Something isn't working

Comments

@kennykerr
Copy link
Collaborator

The param "lptimerfunc" type "TIMERPROC" of SetTimer is option itself, I think it is repeated.

Originally posted by @liqh99em in #3368 (comment)

@kennykerr kennykerr added the bug Something isn't working label Jan 14, 2025
@kennykerr
Copy link
Collaborator Author

kennykerr commented Jan 16, 2025

An example from 0.58 of the windows crate:

use windows::{Win32::Foundation::*, Win32::System::Console::*};

fn main() {
    unsafe {
        SetConsoleCtrlHandler(Some(callback), true).unwrap();
    }
}

unsafe extern "system" fn callback(_ctrltype: u32) -> BOOL {
    BOOL(1)
}

With 0.59 the callback must be double wrapped:

SetConsoleCtrlHandler(Some(Some(callback)), true).unwrap();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant