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

Implements keyword and missing members for an extended interface #388

Closed
Kr00l opened this issue Aug 26, 2021 · 6 comments
Closed

Implements keyword and missing members for an extended interface #388

Kr00l opened this issue Aug 26, 2021 · 6 comments

Comments

@Kr00l
Copy link
Collaborator

Kr00l commented Aug 26, 2021

Describe the bug
I have a type lib with following definition: (which extends IDispatch)

interface IOleInPlaceActiveObjectVB : IDispatch
{
       	[id(0x00000001)]
       	HRESULT TranslateAccelerator([in, out] boolean *Handled, [in, out] LONG *RetVal, [in] LONG hWnd, [in] LONG wMsg, [in] LONG wParam, [in] LONG lParam, [in] LONG Shift);
};

and in VBx I only need to implement the member for TranslateAccelerator.
However, tB want's in addition all the members of the extended interface IDispatch.
But IDispatch is an extended interface of IUnknown. However, tB does not ask for IUnknown members, which is correct.

To Reproduce
n/a

Expected behavior
to not need to have the member definition in a class for IDispatch for above example of IOleInPlaceActiveObjectVB.

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • twinBASIC compiler version [e.g. 0.10.5003]

Additional context
n/a

@WaynePhillipsEA
Copy link
Collaborator

I have a similar defined interface in one of my tests that does not exhibit this problem. Any chance you could you share the typelibrary for me to take a look?

@Kr00l
Copy link
Collaborator Author

Kr00l commented Aug 26, 2021

Sure. Both .odl (source code) and .tlb (compiled file) are located here

@WaynePhillipsEA
Copy link
Collaborator

Ah ok, it's because IOleInPlaceActiveObjectVB inherits from the custom OLEGuids.IDispatch rather than stdole.IDispatch. tB needs to notice the interface IID is the same as IID_IDispatch and auto-implement as if it is stdole.IDispatch

@WaynePhillipsEA
Copy link
Collaborator

Fixed in v0.10.5021. There are probably some other edge cases involving custom defined IDispatch replacements that need to be looked into, but that's for another day. Thanks

@Kr00l
Copy link
Collaborator Author

Kr00l commented Aug 27, 2021

Ah ok, it's because IOleInPlaceActiveObjectVB inherits from the custom OLEGuids.IDispatch rather than stdole.IDispatch. tB needs to notice the interface IID is the same as IID_IDispatch and auto-implement as if it is stdole.IDispatch

The same needs to be done for IID_IUnknown I guess. In the OLEGuids typelib is a custom IUnknownUnrestricted which is the same uuid than stdole.IUnknown.

interface IOleInPlaceActiveObject : IUnknownUnrestricted
{
	LONG GetWindow([out] LONG *phWnd);
	LONG ContextSensitiveHelp([in] LONG fEnterMode);
	LONG TranslateAccelerator([in] LONG lpMsg);
	LONG OnFrameWindowActivate([in] LONG fActivate);
	LONG OnDocWindowActivate([in] LONG fActivate);
	LONG ResizeBorder([in] LONG prcBorder, [in] IOleInPlaceUIWindow *pUIWindow, [in] LONG fFrameWindow);
	LONG EnableModeless([in] LONG fEnable);
};
[
	uuid(00000000-0000-0000-C000-000000000046),
	odl,
	hidden
]
interface IUnknownUnrestricted
{
	LONG QueryInterface([in] LONG priid, [in, out] LONG *pvObj);
	LONG AddRef();
	LONG Release();
};

@WaynePhillipsEA
Copy link
Collaborator

@Kr00l also done for IUnknown in v0.10.5080, thanks.

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