I encountered this while using the lower level interface in 7z.dll - most coders are fine but every filter would give e_nointerface when I try to get an ICompressFilter - rebuilding with this change fixes it:
BcjCoder.h, line 20:
- MY_UNKNOWN_IMP;
+ MY_UNKNOWN_IMP1(ICompressFilter);
not sure what side effects there could be.. all my tests are working fine fwiw.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Excellent, thanks! From the outside the only way we can get these objects return IUnknown (CreateEncoder, CreateDecoder, CreateObject) unless there's another way?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately .NET's interop marshaler still tries to use queryinterface to obtain the ICompressFilter. I also tried declaring ICompressFilter as an abstract class which got me an instance but then throws "Bad IL format" exception as soon as I invoke Init() - probably this way only works for managed libs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I encountered this while using the lower level interface in 7z.dll - most coders are fine but every filter would give e_nointerface when I try to get an ICompressFilter - rebuilding with this change fixes it:
BcjCoder.h, line 20:
- MY_UNKNOWN_IMP;
+ MY_UNKNOWN_IMP1(ICompressFilter);
not sure what side effects there could be.. all my tests are working fine fwiw.
Yes, I can fix it:
ByteSwap.cpp
BranchMisc.h
DeltaFilter.cpp
BcjCoder.h
ICompressFilter is default interface for these coders. So it is not required to request ICompressFilter from them after object creation.
Excellent, thanks! From the outside the only way we can get these objects return IUnknown (CreateEncoder, CreateDecoder, CreateObject) unless there's another way?
CreateEncoder, CreateDecoder and CreateObject can return ICompressFilter.
It's likely a limitation of .NET then. I tried declaring the import this way:
Unfortunately .NET's interop marshaler still tries to use queryinterface to obtain the ICompressFilter. I also tried declaring ICompressFilter as an abstract class which got me an instance but then throws "Bad IL format" exception as soon as I invoke Init() - probably this way only works for managed libs.
OK. I'll fix it in source code.