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

List:       pykde
Subject:    Re: [PyQt] How to write handwritten code to access the C++ object when the corresponding python obje
From:       Weitian Leung <weitianleung () gmail ! com>
Date:       2020-02-20 13:41:16
Message-ID: CADp56LYfOTKWBREpTcmH8ZbtjmuZtSvHEE_cH0RraPWP2oEx5Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


If you mean write the %MethodCode handwritten code to deal all the methods
that contains the BSTR, it's the orignal resolution that I thought before...

I should now start writing the script to do all the works. LoL

Thanks.

On Thu, Feb 20, 2020 at 8:59 PM Phil Thompson <phil@riverbankcomputing.com>
wrote:

> Read the %MethodCode documentation.
>
> On 20/02/2020 12:49, Weitian Leung wrote:
> > Did you mean the wrapped class destructor? It's not the case I want...
> >
> > struct IDemo
> >> {
> >>     virtual void do_sth(BSTR bstr) = 0;
> >> };
> >>
> >
> > The IDemo is created by other C++ interface, the correct way to pass
> > the
> > bstr to *do_sth *is call *SysAllocString*,
> > and after the call returned, we need call *SysFreeString* to free the
> > bstr.
> > Because the IDemo instance will not take over the ownership of the
> > bstr.
> >
> > So when mapped the BSTR to str, it seems that we don't have any chance
> > to
> > call the *SysFreeString *to free the str that allocated inside
> > *%ConvertToTypeCode.*
> >
> >
> >
> > On Thu, Feb 20, 2020 at 5:07 PM Phil Thompson
> > <phil@riverbankcomputing.com>
> > wrote:
> >
> >> I meant the C++ destructor, not __dtor__.
> >>
> >> Phil
> >>
>
>

[Attachment #5 (text/html)]

<div dir="ltr"><div dir="ltr"><div>If you mean write the %MethodCode handwritten code \
to deal all the methods that contains the BSTR, it&#39;s the orignal resolution that \
I thought before...</div><div><br></div><div>I should now start writing the script to \
do all the works. LoL<br></div><div><br></div><div> Thanks.<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 20, 2020 at 8:59 PM \
Phil Thompson &lt;<a \
href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Read the %MethodCode \
documentation.<br> <br>
On 20/02/2020 12:49, Weitian Leung wrote:<br>
&gt; Did you mean the wrapped class destructor? It&#39;s not the case I want...<br>
&gt; <br>
&gt; struct IDemo<br>
&gt;&gt; {<br>
&gt;&gt;        virtual void do_sth(BSTR bstr) = 0;<br>
&gt;&gt; };<br>
&gt;&gt; <br>
&gt; <br>
&gt; The IDemo is created by other C++ interface, the correct way to pass <br>
&gt; the<br>
&gt; bstr to *do_sth *is call *SysAllocString*,<br>
&gt; and after the call returned, we need call *SysFreeString* to free the <br>
&gt; bstr.<br>
&gt; Because the IDemo instance will not take over the ownership of the <br>
&gt; bstr.<br>
&gt; <br>
&gt; So when mapped the BSTR to str, it seems that we don&#39;t have any chance <br>
&gt; to<br>
&gt; call the *SysFreeString *to free the str that allocated inside<br>
&gt; *%ConvertToTypeCode.*<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; On Thu, Feb 20, 2020 at 5:07 PM Phil Thompson <br>
&gt; &lt;<a href="mailto:phil@riverbankcomputing.com" \
target="_blank">phil@riverbankcomputing.com</a>&gt;<br> &gt; wrote:<br>
&gt; <br>
&gt;&gt; I meant the C++ destructor, not __dtor__.<br>
&gt;&gt; <br>
&gt;&gt; Phil<br>
&gt;&gt; <br>
<br>
</blockquote></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


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

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