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

HINSTANCE is missing #924

Closed
harborsiem opened this issue Apr 29, 2023 · 3 comments · Fixed by #930
Closed

HINSTANCE is missing #924

harborsiem opened this issue Apr 29, 2023 · 3 comments · Fixed by #930
Labels
bug Something isn't working

Comments

@harborsiem
Copy link

Actual behavior

IUIFramework.LoadUI() first parameter "instance" now has the type "HMODULE".
CsWin32 version 0.2.223-beta had for the first parameter the type "HINSTANCE".

Expected behavior

The documentation and also the header file UiRibbon.h say that the first parameter type is a HINSTANCE

Repro steps

IUIFramework Framework;
private void Method(HINSTANCE hInstance, string resourceIdent)
{
    Framework = new UIRibbonFramework() as IUIFramework;
    Framework.LoadUI(hInstance, resourceIdent);
}
  1. NativeMethods.txt content:
UIRibbonFramework
IUIFramework

  1. NativeMethods.json content (if present):
  1. Any of your own code that should be shared?

Context

  • CsWin32 version: [0.2.229-beta]
  • Win32Metadata version (if explicitly set by project):
  • Target Framework: [e.g. netstandard2.0]
  • LangVersion (if explicitly set by project): [e.g. 9]
@harborsiem harborsiem added the bug Something isn't working label Apr 29, 2023
@mikebattista
Copy link
Contributor

mikebattista commented May 1, 2023

Once microsoft/win32metadata#1517 is fixed this will be resolved, but that fix is dependent on CsWin32 supporting implicit conversions between HMODULE and HINSTANCE. That's tracked by #199.

@harborsiem
Copy link
Author

It does not work in CsWin32 version 0.2.240-beta.

@AArnott
Copy link
Member

AArnott commented May 10, 2023

@harborsiem, the fix requires a combination of CsWin32 changes (which you have) and the fix in the metadata (which has merged but has not yet shipped). Once those two things are available, CsWin32 will have to update to consume that metadata (or you could try referencing the latest metadata directly and you might get lucky).

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.

3 participants