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

List:       pykde
Subject:    =?gb2312?B?u9i4tDogQ29udmVydFRvU3ViQ2xhc3NDb2RlIGZvciBJRGlzcGF0Y2g=?=
From:       Weitian Leung <just_fancy () live ! com>
Date:       2023-05-19 12:18:19
Message-ID: TYAP286MB05407939F729C7A027085709977C9 () TYAP286MB0540 ! JPNP286 ! PROD ! OUTLOOK ! COM
[Download RAW message or body]

[Attachment #2 (text/plain)]

Sorry, please ignore this thread. It seems that the mail client resend my previous \
draft automatically.

·¢¼þÈË: Weitian Leung<mailto:Just_Fancy@live.com>
·¢ËÍʱ¼ä: 2023Äê5Ô 19ÈÕ 20:15
ÊÕ¼þÈË: pyqt@riverbankcomputing.com<mailto:pyqt@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¡¯£ô change the C++ sdk as it out of my control£®
So is there any chance to make SIP works for such case?

Thanks.


[Attachment #3 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:DengXian;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
.MsoChpDefault
	{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style>
</head>
<body lang="ZH-CN" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Sorry, please ignore this thread. It seems \
that the mail client resend my previous draft automatically.</span><span lang="EN-US" \
style="font-size:12.0pt"><o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:12.0pt;font-family:SimSun"><o:p>&nbsp;</o:p></span></p> \
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 \
1.0pt;padding:3.0pt 0cm 0cm 0cm"> <p class="MsoNormal" \
style="border:none;padding:0cm"><b>·¢¼þÈË<span lang="EN-US">: </span> </b><span \
lang="EN-US"><a href="mailto:Just_Fancy@live.com">Weitian Leung</a><br> \
</span><b>·¢ËÍʱ¼ä<span lang="EN-US">: </span></b><span \
lang="EN-US">2023</span>Äê<span lang="EN-US">5</span>Ô <span \
lang="EN-US">19</span>ÈÕ<span lang="EN-US"> 20:15<br> </span><b>ÊÕ¼þÈË<span \
lang="EN-US">: </span></b><span lang="EN-US"><a \
href="mailto:pyqt@riverbankcomputing.com">pyqt@riverbankcomputing.com</a><br> \
</span><b>Ö÷Ìâ<span lang="EN-US">: </span></b><span \
lang="EN-US">ConvertToSubClassCode for IDispatch</span></p> </div>
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt;font-family:SimSun"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp; I have a IDispatch \
related sdk header, say it contains two IDispatch interfaces:<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">```<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">interface _Foo : public IDispatch \
{</span>¡­<span lang="EN-US">};<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">typedef interface Foo Foo; // No definition at all<o:p></o:p></span></p> \
<p class="MsoNormal"><span lang="EN-US">```<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span 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></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span lang="EN-US">As \
the sdk internal only uses the Foo interface, such as:<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">```<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">interface Bar : public \
IDispatch<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">{<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool open(</span>¡­<span lang="EN-US">, \
Foo** out);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void dosomething(Foo* \
f);<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">};<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">```<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span lang="EN-US">So \
I use ConvertToSubClassCode to resolve the buggy sdk:<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">```<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp; class Foo \
/Abstract,NoDefaultCtors/<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp; %ConvertToSubClassCode<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
sipType = sipType__Foo;<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp; %End<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">&nbsp;&nbsp;&nbsp; };<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">```<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US" style="font-size:12.0pt">It works for `open`, but not for `</span><span \
lang="EN-US">dosomething` due to ConvertToSubClassCode make `open` returns a `_Foo`, \
they have no inherits from python</span>¡¯<span lang="EN-US">s  \
view.<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt;font-family:SimSun">I can</span><span \
style="font-size:12.0pt;font-family:SimSun">¡¯£ô<span lang="EN-US"> change the C++ \
sdk as it out of my control</span>£®<span lang="EN-US"><o:p></o:p></span></span></p> \
<p class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt;font-family:SimSun">So is there any chance to make SIP works \
for such case?<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt;font-family:SimSun"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="font-size:12.0pt;font-family:SimSun">Thanks.<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p> </div>
</body>
</html>



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

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