|
I compiled the code in VS.NET2003 and ran the demo. It worked fine until I decided to open the Properties box, and then a access violation occurred in the DoDataExchange (). It seemed that the dialog resource is not present !!!
Could you please help me in solving the problem?
Thanx a lot.
Regards,
Andrea
|
|
|
|
|
I am not an MFC guy but here is what I found. The popup menu items are processed in XGraphTest.cpp. But the resource id for "Properties" is not connected to anything, so it goes boom.
I also found several of the window buttons on the right do not work because the resource id's are not set up correctly. And I don't know how to fix them.
Regards,
Keith
|
|
|
|
|
I have an application written in C#. Is it possible using this graph tool in C# program?
JR
|
|
|
|
|
Not directly. I am workin to a COM wrap to this class that should be used (via .NET-COM interoperability). I'll keep you uptodated.
Regards,
Andrea
|
|
|
|
|
Hi,
how successful are you with your COM-wrapper?
Regards,
gunag
|
|
|
|
|
Using Visual Studio .NET 2003 on WinXP I was not able to build the demo program. I was getting link errors for unresolved external symbols for the CXGraph::InsertLabel() and CXGraphAxis::SetColorRange(). From searching through the posts this appears to have been a known problem since the start of the year. Well, I found the solution.
The include directory in the demo does not contain the latest .h files.
1. In addition to downloading the demo project you must also download the source. Build the source as a separate project.
2. In the demo project remove the include directory (and it's contents).
3. Add the source project directory as an include directory so the correct version of the .h files are used.
4. Some files will not build because the include path is wrong so change those from "include/xgraph10.h" to <xgraph10.h>
5. I could not get the library path to work so copy the XGRAPH10.dll file from the source project to the demo project.
Then it worked.
-- modified at 11:40 Thursday 15th September, 2005 -- changed one bit of formatting for clarity
|
|
|
|
|
I got an email asking for clarification on a few items, so I will add my response here also.
> 3. Add the source project directory as an include directory so the correct version of the .h files are used.
This is done from the Project > XGraphTest Properties dialog. The C/C++ item has an entry called Additional Include Directories. This is where to add the location of your XGraph library source directory.
> 4. Some files will not build because the include path is wrong so change those from "include/xgraph10.h" to <xgraph10.h>
This is only needed for 2 files: PropertyView.h, XGraphTestView.h
> 5. I could not get the library path to work so copy the XGRAPH10.dll file from the source project to the demo project.
Just overwrite the one in your build directory ("Release").
If anyone can make the library path work please add that info to this thread.
|
|
|
|
|
I made an empty SDI-project and did this:
"XGraph10.lib" in "linker/input"
Copied the include-directory from the demo to my project directory
#include "include/xgraph10.h" in the view-header file
Until now it compiles and run.
But when I add "CXGraph m_Graph[2]" to the View-class, I get the following error msg:
"failed to create empty document"
Does anyone know what went wrong?
|
|
|
|
|
After you create the XGraph,you should SetData() to it.
|
|
|
|
|
I have done that. The error appears when I define the chart control:
CXGraph m_Graph[2];
Shall the control be attached to a bitmap? I see in the demo that a bitmap is defined in the header-file for the view:
CBitmapEx m_Bitmap;
But I can not see any placec where it is used.
Both the demo and my test-app failed to start the chart control (can not create empty document)
|
|
|
|
|
When calling ResetAll() after using the Measure - mode, windows reports an Access Violation Error.
I added DeleteMeasures() to ResetAll() and now it seems to work.
void CXGraph::ResetAll()
{
m_XAxis.clear ();
m_YAxis.clear ();
m_Data.clear ();
-> DeleteMeasures();
...
}
|
|
|
|
|
I have to use this class to display 2 or 3 curves and the values update every minute.
When I set a group of data the previous curve disappeared.
Can the Class set several datagroup at the same time?
What can I do about this?
|
|
|
|
|
Hi,
i tried the SaveBitmap() function today. I found out, that you capture the whole window and then save it to a file. This is unpractical, if you have some other windows/dialogs overlayed. So I did some changes to save only the chart as such.
All changes are in XGraph.cpp!
1. Add to constructor:
m_pBitmap = NULL;
2. Add to destructor:
delete m_pBitmap;
3. Add on the end of OnPaint() but bevor:
<br />
if (nSaveDC)<br />
pDC->RestoreDC(nSaveDC);<br />
following lines:
<br />
CDC memDC;<br />
memDC.CreateCompatibleDC(pDC); <br />
if (!m_pBitmap)<br />
m_pBitmap = (CBitmap*) new CBitmap;<br />
else<br />
m_pBitmap->DeleteObject();<br />
m_pBitmap->CreateCompatibleBitmap(pDC,clRect.Width(),clRect.Height()); <br />
CBitmap* pOldBitmap = memDC.SelectObject(m_pBitmap);<br />
memDC.BitBlt(0,0,clRect.Width(),clRect.Height(),pDC,0,0,SRCCOPY); <br />
memDC.SelectObject(pOldBitmap);<br />
So, now we have the exact copy of current chart image in the pBitmap.
4. Change SaveBitmap():
<br />
BOOL CXGraph::SaveBitmap(const CString cFile)<br />
{<br />
CWnd* pWnd = this;<br />
CWindowDC dc(pWnd);<br />
<br />
CPalette pal;<br />
if (dc.GetDeviceCaps(RASTERCAPS) & RC_PALETTE)<br />
{<br />
UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);<br />
LOGPALETTE *pLP = (LOGPALETTE*) new BYTE[nSize];<br />
pLP->palVersion = 0x300;<br />
<br />
pLP->palNumEntries = GetSystemPaletteEntries(dc,0,255,pLP->palPalEntry);<br />
<br />
pal.CreatePalette(pLP);<br />
<br />
delete[] pLP;<br />
}<br />
<br />
HANDLE hDIB = DDBToDIB(*m_pBitmap, BI_RGB, &pal);<br />
<br />
if (hDIB == NULL)<br />
return FALSE;<br />
<br />
WriteDIB(const_cast <char*>( (LPCTSTR) cFile ), hDIB);<br />
<br />
GlobalFree(hDIB);<br />
return TRUE;<br />
}<br />
That's all...
|
|
|
|
|
This works, tested and proven, and works sweet!
However, an amendment is required to WriteDIB, use the following instead:
WriteDIB (const_cast<char*>((LPCTSTR)cFile), hDIB);
HMTL tags....
Cheers!
-- modified at 11:24 Wednesday 24th January, 2007
|
|
|
|
|
Correction, the code fouls up the XGraph-properties page when you double click a series line. Anyone knows the fix?
|
|
|
|
|
How I can set marker's on curve from my program without mouse(by XYcoordinats )?
PLEASE HELP????
|
|
|
|
|
Are you planing to make english version of the library
and it's sources? I mean translating comments, error
messages...
Best regards, Igor
|
|
|
|
|
substitute IDC_CBFILLCURVE by IDC_CBFILL
|
|
|
|
|
This is a solution from earlier post::
1. precompiled header error
go to the "project" -> "settings" menu, choose "settings for all configurations", choose the "C/C++" screen and there the category "precompiled headers". select the second radio button for using precompiled headers autommaticly with the header "stdafx.h"
2. other build problems
try to build a "Win32 Release" or "Win32 Debug" instead of a "Win32 Unicode Release" or "Win32 Unicode Debug". For this go to "build" -> "set active configuration" menu and choose "XGRAPH - Win32 Release" or "XGRAPH - Win32 Debug"
3. doubleclick / properties bug:
search for "cbFillCurve" in CurveDlg.cpp, CurveDlg.h and resource.h, and comment out all the lines including this string.
4. background-redrawing bug:
go to XGRAPH.cpp, search for the string "pmdc = new CMemDC(pdc)" (should be about line 920), comment it out and add the four following lines insetead of it:
CRect empty, client;
GetClientRect( client );
empty.SetRectEmpty();
pmdc = new CMemDC(pdc, empty, client);
hope it could help. regards from Lake Constance, greg.
|
|
|
|
|
Could you upload the whole source code of the demo(binary version) project?
It is difficult to me to use the class member funtion...
iskim2002@korea.com
|
|
|
|
|
Hello.
I use MSVC 6 SP5, I can build, but when double clicking on curves, axes, ... i get exception... with compiled dll from example work all ok, but there not dll and library with debug information... What I do wrong or maybe other version need to build?
With best regrads,
Andrey.
|
|
|
|
|
The application is failing due to a missing control on a dialog box. Go to the dialog box IDD_CURVE in resource editor and add a combo box in between the "Fill area beneath curve" check box and the "Transparent" check box. In the Properties set the ID to IDC_CBFILLCURVE. Rebuild and Bob's your uncle. Best of luck.
|
|
|
|
|
Hello Gunnar,
I have noticed a problem with clipping, when moving a XGraph window out of a client's range. This comes from CMemDC using the inner clipping area, which is wrong in this context.
CMemDC(CDC* pDC, int nOffset = 0) : CDC()
{
ASSERT(pDC != NULL);
m_pDC = pDC;
m_pOldBitmap = NULL;
m_bMemDC = !pDC->IsPrinting();
m_DstRect.SetRectEmpty();
if (m_bMemDC) // Create a Memory DC
{
//pDC->GetClipBox(&m_rect); // this would use inner clipping region
pDC->GetWindow()->GetClientRect(&m_rect); // my solution for the moment.
Perhaps you did already know of this...
XGraph is very useful and the code is powerfull and easy to understand, although small code size.
Greetings,
Martin.
|
|
|
|
|
I'm new to xgraph.I keep getting the following error when i trying to compile the demo of xgraph.
XGraph Dll PROGRAM
1. Go to the "project" -> "settings" menu, choose "settings for all configurations",
choose the "General" screen and there the category
"Character Set = Use Unicode Character Set"
DEMO PROGRAM
2. Go to the "project" -> "settings" menu, choose "settings for all configurations",
choose the "General" screen and there the category
"Character Set = Use Unicode Character Set"
3.Demo program have this error:
Linking...
Creating library .\Debug/XGraphTest.lib and object .\Debug/XGraphTest.exp
PropertyView.obj : error LNK2019: unresolved external symbol "public: class CXGraphLabel & __thiscall CXGraph::InsertLabel(class ATL::CStringT<unsigned short,class="" strtraitmfc<unsigned="" atl::chtraitscrt<unsigned="" short=""> > >)" (?InsertLabel@CXGraph@@QAEAAVCXGraphLabel@@V?$CStringT@GV?$StrTraitMFC@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@@Z) referenced in function "protected: void __thiscall CPropertyView::OnInsertLabel(void)" (?OnInsertLabel@CPropertyView@@IAEXXZ)
XGraphTestView.obj : error LNK2019: unresolved external symbol "public: void __thiscall CXGraphAxis::SetColorRange(int,double,double,unsigned long,unsigned long,class ATL::CStringT<unsigned short,class="" strtraitmfc<unsigned="" atl::chtraitscrt<unsigned="" short=""> > >,unsigned int)" (?SetColorRange@CXGraphAxis@@QAEXHNNKKV?$CStringT@GV?$StrTraitMFC@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@I@Z) referenced in function "public: void __thiscall CXGraphTestView::AddDataSerie(bool)" (?AddDataSerie@CXGraphTestView@@QAEX_N@Z)
.\Debug/XGraphTest.exe : fatal error LNK1120: 2 unresolved externals
4.Can the XGraph be use whit "Character Set = Use Unicode Character Set"?
any ideas on this problem, it will would be a great help.
|
|
|
|
|
How can I use it as an ActiveX, for VB and C++Builder? "regsvr32 XGRAPH10.dll" will not work.
Thanks in advance!
-Kona
|
|
|
|