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

MarshalDirectiveException was threw in ComCtl32.SetWindowSubclass #393

Closed
zhuxb711 opened this issue Apr 26, 2023 · 0 comments
Closed

MarshalDirectiveException was threw in ComCtl32.SetWindowSubclass #393

zhuxb711 opened this issue Apr 26, 2023 · 0 comments

Comments

@zhuxb711
Copy link

Describe the bug and how to reproduce
Should be the definition issue, error message:
Cannot marshal 'parameter #3': Invalid managed/unmanaged type combination (Int32/UInt32 must be paired with I4, U4, or Error)

What code is involved

ComCtl32.SetWindowSubclass(<Your window handle>, <Your delegate>, 0, IntPtr.Zero);

This code works for me

[DllImport("Comctl32.dll", SetLastError = true)]
public static extern bool SetWindowSubclass(IntPtr hWnd, SUBCLASSPROC pfnSubclass, IntPtr uIdSubclass, IntPtr dwRefData);

public delegate IntPtr SUBCLASSPROC(HWND hWnd, uint uMsg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, IntPtr dwRefData);
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

No branches or pull requests

2 participants