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

IUnknown. COM Interface support #8

Open
3F opened this issue Dec 28, 2016 · 0 comments
Open

IUnknown. COM Interface support #8

3F opened this issue Dec 28, 2016 · 0 comments

Comments

@3F
Copy link
Owner

3F commented Dec 28, 2016

Currently all works fine, but I need more flexible things like here #2

How we can play with current versions:

// the working half-declaration of original interface:
[Guid("23170F69-40C1-278A-0000-000600600000")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IInArchive
{
      void a(); void b();
 
0x02: uint GetNumberOfArchiveProperties();                             // <-- uint GetNumberOfItems();
                                                                            |
      void c(); void d(); void e(); void f(); void g();                     |
                                                                            |
0x08: uint GetNumberOfItems(); //uint GetNumberOfArchiveProperties();  // <-/  moreover, it can be like MySPecial001() for calling from our side.
}
...

IInArchive ar;
// DLR for STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
l.DLR.CreateObject<int>(ref cid, ref iid, out ar); 
ar.GetNumberOfItems() <--> GetNumberOfArchiveProperties()  // ok

How about of Inheritance:

In COM it does not mean code reuse, it means only that contract associated with an interface is inherited.

The coreclr could have better support for all IUnknown interfaces like a COW. I mean we already have contract for all this, why not to wrap this via optional allocation of new required records and remap pointers for new slot. But anyway, it requires any modifications of this, so... my time -_-

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("23170F69-40C1-278A-0000-000300010000")]
public interface ISequentialInStream
{
    void Read(...);
}
 
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("23170F69-40C1-278A-0000-000300030000")]
public interface IInStream: ISequentialInStream
{
    void m(...);    // only as offset of position like above. The Read() from base we still can't use
    void Seek(...); // ok 
}

just to think

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

1 participant