<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">Hello,<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> I have a IDispatch related sdk header,
say it contains two IDispatch interfaces:<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">interface _Foo : public IDispatch {</span><span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0">¡<span class="ContentPasted0" lang="EN-US">};<o:p class="ContentPasted0"> </o:p></span></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">typedef interface Foo Foo; // No definition
at all<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">`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.<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">As the sdk internal only uses the Foo
interface, such as:<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">interface Bar : public IDispatch<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">{<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> bool open(</span><span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0">¡<span class="ContentPasted0" lang="EN-US">,
Foo** out);<o:p class="ContentPasted0"> </o:p></span></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> void dosomething(Foo* f);<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">};<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">So I use ConvertToSubClassCode to resolve
the buggy sdk:<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> class Foo /Abstract,NoDefaultCtors/<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> {<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> %ConvertToSubClassCode<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> sipType = sipType__Foo;<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> %End<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US"> };<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">```<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">It works for `open`, but not for `</span><span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">dosomething`
due to ConvertToSubClassCode make `open` returns a `_Foo`, they have no inherits from python</span><span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0">¡¯<span class="ContentPasted0" lang="EN-US">s
view.<o:p class="ContentPasted0"> </o:p></span></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="mso-bidi-font-size:10.5pt;mso-ascii-font-family:DengXian;mso-fareast-font-family:DengXian;mso-hansi-font-family:DengXian;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;font-family:SimSun;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">I can</span><span style="font-size:12.0pt;font-family:SimSun;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0">¡¯£ô<span class="ContentPasted0" lang="EN-US">
change the C++ sdk as it out of my control</span>£®<span lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;font-family:SimSun;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">So is there any chance to make SIP works for such case?<o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;font-family:SimSun;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" lang="EN-US"><o:p class="ContentPasted0"> </o:p></span></p>
<p class="MsoNormal" style="margin:0cm;text-align:justify;font-size:10.5pt;font-family:DengXian;mso-pagination:widow-orphan">
<span style="font-size:12.0pt;font-family:SimSun;mso-bidi-font-family:SimSun;mso-font-kerning:0pt" class="ContentPasted0" lang="EN-US">Thanks.<o:p class="ContentPasted0"> </o:p></span></p>
<br>
</div>
</body>
</html>