Qt-interest Archive, May 2007
Does Qt4.3 generate a better/worse wrapper than previous versions?
Message 1 in thread
My tests is based on the latest Qt:
qt-win-commercial-src-4.3.0-snapshot-20070508.zip compiled by vs2003 on
WindowsXP.
The container is PowerPoint 2003 sp2
What I did:
1) dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
to generate wrapper classes for PowerPoint.
2) include *.h in my project, and use it for automation (to generate ppt
programmatically).
PowerPoint::Application *oPPTApp = new PowerPoint::Application();
oPPTApp->dynamicCall("SetVisible(Office::MsoTriState)", true);
PowerPoint::Presentations* presentations = oPPTApp->Presentations();
PowerPoint::Presentation* presentation = presentations->Add(); // crash ???
The last line of code crashes the application, and in debug window shows:
“First-chance exception at 0x00404a23 in qppt.exe: 0xC0000005: Access
violation reading location 0x00000000.”
Instead of version 4.3, dumpcpp in Qt4.1.1 works fine, for example
c:\Qt\4.1.1\bin\dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
I wonder if this is a bug.
Thanks in advance,
Lingfa
--
[ signature omitted ]
Message 2 in thread
Obviously:
PowerPoint::Presentations* presentations = oPPTApp->Presentations();
"presentations" is null (oPPTApp->Presentations() returns null -- no
presentations?), and you are not checking before using it.
There is a lot of error checking missing in your code. What happens if
PowerPoint is not installed? If there are no Presentations? If you cannot
Add() (presentation is read-only?)?
I don't know the specifics on the PowerPoint end, but there are a lot of
assumptions here.
Keith
**Please do not reply to me, reply to the list.**
On 05-09-2007 10:50 AM, "Lingfa Yang" wrote:
> My tests is based on the latest Qt:
> qt-win-commercial-src-4.3.0-snapshot-20070508.zip compiled by vs2003 on
> WindowsXP.
> The container is PowerPoint 2003 sp2
>
> What I did:
> 1) dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
> to generate wrapper classes for PowerPoint.
>
> 2) include *.h in my project, and use it for automation (to generate ppt
> programmatically).
> PowerPoint::Application *oPPTApp = new PowerPoint::Application();
> oPPTApp->dynamicCall("SetVisible(Office::MsoTriState)", true);
>
> PowerPoint::Presentations* presentations = oPPTApp->Presentations();
> PowerPoint::Presentation* presentation = presentations->Add(); // crash ???
>
> The last line of code crashes the application, and in debug window shows:
> ³First-chance exception at 0x00404a23 in qppt.exe: 0xC0000005: Access
> violation reading location 0x00000000.²
>
> Instead of version 4.3, dumpcpp in Qt4.1.1 works fine, for example
> c:\Qt\4.1.1\bin\dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
>
> I wonder if this is a bug.
> Thanks in advance,
> Lingfa
--
[ signature omitted ]
Message 3 in thread
Keith Esau wrote:
>Obviously:
>
> PowerPoint::Presentations* presentations = oPPTApp->Presentations();
>
>"presentations" is null (oPPTApp->Presentations() returns null -- no
>presentations?), and you are not checking before using it.
>
>
My point is why "presentations" is NULL with Qt4.3, but NOT null with
previous version of the same code?
>There is a lot of error checking missing in your code. What happens if
>PowerPoint is not installed? If there are no Presentations? If you cannot
>Add() (presentation is read-only?)?
>
>
Of course this 4 line of code is simplified for questioning. I do have
condition checks to block NULL and void crashes.
>I don't know the specifics on the PowerPoint end, but there are a lot of
>assumptions here.
>
>
>
This is not about PowerPoint. This is about "dumpcpp”, a tool of Qt.
Just run two versions of dumpcpp and compare.
>Keith
>**Please do not reply to me, reply to the list.**
>
>On 05-09-2007 10:50 AM, "Lingfa Yang" wrote:
>
>
>
>>My tests is based on the latest Qt:
>>qt-win-commercial-src-4.3.0-snapshot-20070508.zip compiled by vs2003 on
>>WindowsXP.
>>The container is PowerPoint 2003 sp2
>>
>>What I did:
>>1) dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
>>to generate wrapper classes for PowerPoint.
>>
>>2) include *.h in my project, and use it for automation (to generate ppt
>>programmatically).
>>PowerPoint::Application *oPPTApp = new PowerPoint::Application();
>>oPPTApp->dynamicCall("SetVisible(Office::MsoTriState)", true);
>>
>>PowerPoint::Presentations* presentations = oPPTApp->Presentations();
>>PowerPoint::Presentation* presentation = presentations->Add(); // crash ???
>>
>>The last line of code crashes the application, and in debug window shows:
>>³First-chance exception at 0x00404a23 in qppt.exe: 0xC0000005: Access
>>violation reading location 0x00000000.²
>>
>>Instead of version 4.3, dumpcpp in Qt4.1.1 works fine, for example
>>c:\Qt\4.1.1\bin\dumpcpp {91493440-5A91-11CF-8700-00AA0060263B}
>>
>>I wonder if this is a bug.
>>Thanks in advance,
>>Lingfa
>>
>>
>
>
>--
>To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
>List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>
--
[ signature omitted ]