Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - get XTPReport itemtext
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

get XTPReport itemtext

 Post Reply Post Reply
Author
Message
xinyang View Drop Down
Groupie
Groupie


Joined: 12 July 2009
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote xinyang Quote  Post ReplyReply Direct Link To This Post Topic: get XTPReport itemtext
    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 ?
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2009 at 6:47pm

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);

}

}

Back to Top
xinyang View Drop Down
Groupie
Groupie


Joined: 12 July 2009
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote xinyang Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2009 at 5:47am

thank you for your reply !   my problem is this  ,Another program has access to  XTPReport‘s cell text

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 12:02pm
Is this Another programm is also MFC - CJ Ext?
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 4:00pm
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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 4:02pm
No - he want to make automated tester. It will only work if testing app support automation
Back to Top
xinyang View Drop Down
Groupie
Groupie


Joined: 12 July 2009
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote xinyang Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 8:47pm
thank you !   Yes , programms both are mfc .   your means  is that  my  aim is Mission impossible?
Back to Top
xinyang View Drop Down
Groupie
Groupie


Joined: 12 July 2009
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote xinyang Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 8:56pm
   your means  is that "xtpreport" don't support  automation test? Are you sure?  i am  Beginners!
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 8:33am
this is not Report Control should support automation but the app you need to test - e.g. MS Office
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 8:38am
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.
Back to Top
xinyang View Drop Down
Groupie
Groupie


Joined: 12 July 2009
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote xinyang Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 11:32pm
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 .
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2009 at 9:17am
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.