get XTPReport itemtext |
Post Reply |
Author | |
xinyang
Groupie Joined: 12 July 2009 Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 13 July 2009 at 12:32pm |
I would like get XTPReport itemtext , from the outside;
HWND hchild=::FindWindowEx(hp, NULL,"XTPReport",NULL);
if(hchild) { CXTPReportControl* m_wndReport=new CXTPReportControl();
m_wndReport->Attach(hchild);
CXTPReportRows* m_reportrow=new CXTPReportRows();
m_reportrow=m_wndReport->GetRows();
int count=m_reportrow->GetCount(); //but count=0; have a error;
} How I should do to get XTPReport itemtext ?
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
The big question is WHY you need it? this dirty code is working in same app - try to modify it to use passed window handle
HWND hchild = ::FindWindowEx(GetSafeHwnd(), NULL, "XTPReport", NULL); if (hchild) {CWnd* pWnd = FromHandle(hchild); if (pWnd) {CXTPReportControl* pReport = (CXTPReportControl*) pWnd; CXTPReportRows* pRows = pReport->GetRows(); CXTPReportColumns* pCols = pReport->GetColumns(); int c_r(0), c_c(0); if (pRows)c_r = pRows->GetCount(); if (pCols)c_c = pCols->GetCount(); CString s; s.Format(_T( "RC %d x %d"), c_r, c_c);GetDlgItem(IDC_BUTTON_DEVTEST)->SetWindowText(s); } } |
|
xinyang
Groupie Joined: 12 July 2009 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
thank you for your reply ! my problem is this ,Another program has access to XTPReport‘s cell text |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Is this Another programm is also MFC - CJ Ext?
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi;
Have you ever heard of interprocess communication (e.g. shared memory, good old DDE, named pipes, ...). You can't directly access memory of another process! |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
No - he want to make automated tester. It will only work if testing app support automation
|
|
xinyang
Groupie Joined: 12 July 2009 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
thank you ! Yes , programms both are mfc . your means is that my aim is Mission impossible?
|
|
xinyang
Groupie Joined: 12 July 2009 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
your means is that "xtpreport" don't support automation test? Are you sure? i am Beginners!
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
this is not Report Control should support automation but the app you need to test - e.g. MS Office
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
What do you want to test? You can add automation to app with Report Control inside and command this internal Report Control throw automation like you can control Excel spreadsheet with Excel automation. But this is not so easy to do.
|
|
xinyang
Groupie Joined: 12 July 2009 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
thank you ! The application with "Report Control" is another person's . I only use it , don't have code, and cannot alter it. I would like to obtain XTPReport‘s item text throught other way, like automation test UI . find dialog , find Report Control , and then get XTPReport‘s item text .
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
In this case read somebody comment:
>>Have you ever heard of interprocess communication (e.g. shared memory, good old DDE, named pipes, ...). You can't directly access memory of another process!
and try another way to test your another person app. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |