[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    =?UTF-8?Q?=E5=9B=9E=E5=A4=8D=EF=BC=9AConvertToSubCla?= =?UTF-8?Q?ssCode_for_IDispatch?=
From:       ‪‪‪‪just_fancy () live ! com‬‬‬‬ <just_f
Date:       2023-04-30 15:53:40
Message-ID: TYAP286MB0540218DF2F607EFFAA3985097699 () TYAP286MB0540 ! JPNP286 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="auto">Yes it means compiles and runs fine.<div>What did you mean `wrapped _Foo`?&nbsp;</div><div>The _Foo just write as normal class, no special code in sip file.<br><br><br><br><br></div></div><div style="line-height:1.5"><br><br>-------- 原始邮件 --------<br>发件人: Phil Thompson &lt;phil@riverbankcomputing.com&gt;<br>日期: 2023年4月30日周日 23:42<br>收件人: &quot;‪‪‪‪just_fancy@live.com‬‬‬‬&quot; &lt;just_fancy@live.com&gt;<br>抄送: pyqt@riverbankcomputing.com<br>主    题: Re: 回复:ConvertToSubClassCode for IDispatch<br>On 30/04/2023 16:10, ‪‪‪‪just_fancy@live.com‬‬‬‬ wrote:<br>&gt; No, it's `typedef interface Foo Foo` and without further definition.<br>&gt; It works for `open` I mean the returned foo, it could use as _Foo<br>&gt; normally (_Foo contains methods).<br>&gt; But I can't pass the foo returns from `open` to `dosomething` . It's<br>&gt; actully a _Foo because I use ConvertToSubClassCode for `Foo`<br><br>&quot;It works&quot; means it compiles or it runs correctly?<br><br>Have you wrapped _Foo?<br><br>Phil<br><br>&gt; -------- 原始邮件 --------<br>&gt; 发件人: Phil Thompson &lt;phil@riverbankcomputing.com&gt;<br>&gt; 日期: 2023年4月30日周日 22:27<br>&gt; 收件人: Weitian Leung &lt;Just_Fancy@live.com&gt;<br>&gt; 抄送: pyqt@riverbankcomputing.com<br>&gt; 主 题: Re: ConvertToSubClassCode for IDispatch<br>&gt; <br>&gt;&gt; On 30/04/2023 14:39, Weitian Leung wrote:<br>&gt;&gt;&gt; Hello,<br>&gt;&gt;&gt; I have a IDispatch related sdk header, say it contains two<br>&gt;&gt;&gt; IDispatch interfaces:<br>&gt;&gt;&gt; ```<br>&gt;&gt;&gt; interface _Foo : public IDispatch {…};<br>&gt;&gt;&gt; typedef interface Foo Foo; // No definition at all<br>&gt;&gt;&gt; ```<br>&gt;&gt; <br>&gt;&gt; Do you mean...<br>&gt;&gt; <br>&gt;&gt; typedef interface _Foo Foo;<br>&gt;&gt; <br>&gt;&gt;&gt; `Foo` can be QueryInterface from `_Foo` in C++ (or just do a<br>&gt;&gt; cast),<br>&gt;&gt;&gt; and for this case I asume they are just the same class.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; As the sdk internal only uses the Foo interface, such as:<br>&gt;&gt;&gt; ```<br>&gt;&gt;&gt; interface Bar : public IDispatch<br>&gt;&gt;&gt; {<br>&gt;&gt;&gt; bool open(…, Foo** out);<br>&gt;&gt;&gt; void dosomething(Foo* f);<br>&gt;&gt;&gt; };<br>&gt;&gt;&gt; ```<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; So I use ConvertToSubClassCode to resolve the buggy sdk:<br>&gt;&gt;&gt; ```<br>&gt;&gt;&gt; class Foo /Abstract,NoDefaultCtors/<br>&gt;&gt;&gt; {<br>&gt;&gt;&gt; %ConvertToSubClassCode<br>&gt;&gt;&gt; sipType = sipType__Foo;<br>&gt;&gt;&gt; %End<br>&gt;&gt;&gt; };<br>&gt;&gt;&gt; ```<br>&gt;&gt; <br>&gt;&gt; As Foo above doesn't have a super-class, and nothing sub-classes it,<br>&gt;&gt; the<br>&gt;&gt; %ConvertToSubClassCode isn't having any effect.<br>&gt;&gt; <br>&gt;&gt;&gt; It works for `open`, but not for `dosomething` due to<br>&gt;&gt;&gt; ConvertToSubClassCode make `open` returns a `_Foo`, they have no<br>&gt;&gt;&gt; inherits from python's view.<br>&gt;&gt; <br>&gt;&gt; Sorry, I don't understand what you mean. What do you mean by &quot;it<br>&gt;&gt; works&quot;?<br>&gt;&gt; <br>&gt;&gt;&gt; I can't change the C++ sdk as it out of my control.<br>&gt;&gt;&gt; So is there any chance to make SIP works for such case?<br>&gt;&gt; <br>&gt;&gt; Your example is too incomplete to say.<br>&gt;&gt; <br>&gt;&gt; Phil<br></div>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic