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