回复: ConvertToSubClassCode for IDispatch
Weitian Leung
just_fancy at live.com
Fri May 19 13:18:19 BST 2023
Sorry, please ignore this thread. It seems that the mail client resend my previous draft automatically.
发件人: Weitian Leung<mailto:Just_Fancy at live.com>
发送时间: 2023年5月19日 20:15
收件人: pyqt at riverbankcomputing.com<mailto:pyqt at riverbankcomputing.com>
主题: ConvertToSubClassCode for IDispatch
Hello,
I have a IDispatch related sdk header, say it contains two IDispatch interfaces:
```
interface _Foo : public IDispatch {…};
typedef interface Foo Foo; // No definition at all
```
`Foo` can be QueryInterface from `_Foo` in C++ (or just do a cast), and for this case I asume they are just the same class.
As the sdk internal only uses the Foo interface, such as:
```
interface Bar : public IDispatch
{
bool open(…, Foo** out);
void dosomething(Foo* f);
};
```
So I use ConvertToSubClassCode to resolve the buggy sdk:
```
class Foo /Abstract,NoDefaultCtors/
{
%ConvertToSubClassCode
sipType = sipType__Foo;
%End
};
```
It works for `open`, but not for `dosomething` due to ConvertToSubClassCode make `open` returns a `_Foo`, they have no inherits from python’s view.
I can’t change the C++ sdk as it out of my control.
So is there any chance to make SIP works for such case?
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230519/4a451084/attachment-0001.htm>
More information about the PyQt
mailing list