Print Page | Close Window

get XTPReport itemtext

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14734
Printed Date: 16 May 2024 at 6:15am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: get XTPReport itemtext
Posted By: xinyang
Subject: get XTPReport itemtext
Date 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 ?



Replies:
Posted By: mdoubson
Date 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);

}

}



-------------
Mark Doubson, Ph.D.


Posted By: xinyang
Date 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



Posted By: mdoubson
Date Posted: 23 July 2009 at 12:02pm
Is this Another programm is also MFC - CJ Ext?

-------------
Mark Doubson, Ph.D.


Posted By: mgampi
Date 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


Posted By: mdoubson
Date Posted: 23 July 2009 at 4:02pm
No - he want to make automated tester. It will only work if testing app support automation

-------------
Mark Doubson, Ph.D.


Posted By: xinyang
Date Posted: 23 July 2009 at 8:47pm
thank you !   Yes , programms both are mfc .   your means  is that  my  aim is Mission impossible?


Posted By: xinyang
Date Posted: 23 July 2009 at 8:56pm
   your means  is that "xtpreport" don't support  automation test? Are you sure?  i am  Beginners!


Posted By: mdoubson
Date 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

-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date 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.

-------------
Mark Doubson, Ph.D.


Posted By: xinyang
Date 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 .


Posted By: mdoubson
Date 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.


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net