Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
class StripChartWindow : public PegDecoratedWindow
{
public:
StripChartWindow(const PegRect& Rect, const PEGUINT TitleId);
virtual ~StripChartWindow() {}
virtual PEGINT Message(const PegMessage& Mesg);
private:
PegStripChart* mpChart;
PegStripChart* mpChart2;
PEGUBYTE mID;
PEGUBYTE mSin;
PEGUBYTE mID2;
PEGUBYTE mSin2;
};
This is the part which is givin me errors as below...
error C2143: syntax error : missing ';' before '*'
error C2501: 'PegStripChart' : missing storage-class or type specifiers
error C2501: 'mpChart' : missing storage-class or type specifiers
error C2143: syntax error : missing ';' before '*'
error C2501: 'PegStripChart' : missing storage-class or type specifiers
error C2501: 'mpChart2' : missing storage-class or type specifiers
fatal error C1070: mismatched #if/#endif pair in file new.hpp'
Error executing cl.exe.
It doesn't recognize the type "PegStripChart". You forgot to include something? Or made a typo? I can't tell without the rest of the code.
THIS IS THE WHOLE CODE DO PLS HELP ME OUT
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// Source file originally created by PegWindowBuilder
//
//
// Class Name: newclass
//
// Notes:
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
#include "peg.hpp"
#include "new_res.hpp"
#include "new.hpp"
extern PegResourceTable stchart_ResourceTable;
PEGINT gChartData[] = { 100, 100, 100, 100, 100, 100, 125, 150, 175, 200,
150, 100, 50, 100, 125, 100, 100, 100 };
PEGINT gBukData[] = { 100, 100, 100, 100, 100, 100, 100, 100, 125, 100,
100, 120, 140, 160, 180, 200, 150, 100, 50, 125, 100,
100, 125, 150, 125, 100, 100, 100, 100 };
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
StripChartWindow::StripChartWindow(const PegRect& Rect, const PEGUINT TitleId) :
PegDecoratedWindow(Rect)
{
PEGCOLOR tempColor1, tempColor2, tempColor3;
if(TitleId)
{
Add(new PegTitle(TitleId));
}
PegRect ChartRect = mClient;
ChartRect.Bottom = mClient.Height() / 2 - 2;
mpChart = new PegStripChart(ChartRect, 130, -100, 700, 10, 100);
mpChart->SetExStyle(mpChart->GetExStyle() | CS_DRAWYGRID | CS_DRAWXGRID |
CS_DRAWXTICS | CS_DRAWYLABELS | CS_SCROLLED |
//CS_DUALYTICS | CS_DRAWLINEFILL | CS_DRAWXLABELS |
CS_DUALYTICS | CS_DRAWXLABELS |
CS_DUALYLABELS);
mpChart->SetExStyle(mpChart->GetExStyle() & ~CS_PAGED);
Add(mpChart);
tempColor1 = PegResourceManager::GetColor(CID_CYAN);
tempColor2 = PegResourceManager::GetColor(CID_BLUE);
tempColor3 = PegResourceManager::GetColor(CID_MAGENTA);
mSin = mpChart->AddLine(tempColor1, tempColor1, tempColor3);
tempColor1 = PegResourceManager::GetColor(CID_LIGHTGREEN);
tempColor2 = PegResourceManager::GetColor(CID_GREEN);
tempColor3 = PegResourceManager::GetColor(CID_RED);
mID = mpChart->AddLine(tempColor1, tempColor1, tempColor3);
mpChart->SetYLabelScale(200);
ChartRect.Top = ChartRect.Bottom + 4;
ChartRect.Bottom = mClient.Bottom;
mpChart2 = new PegStripChart(ChartRect, 130, -200, 600, 10, 100);
mpChart2->SetExStyle(mpChart2->GetExStyle() | CS_DRAWAGED |
CS_XAXISONZEROY | CS_DRAWXTICS | CS_DRAWXLABELS);
//CS_DRAWLINEFILL);
Add(mpChart2);
tempColor1 = PegResourceManager::GetColor(CID_LIGHTBLUE);
tempColor2 = PegResourceManager::GetColor(CID_BLUE);
tempColor3 = PegResourceManager::GetColor(CID_CYAN);
mSin2 = mpChart2->AddLine(tempColor1, tempColor1, tempColor3);
tempColor1 = PegResourceManager::GetColor(CID_LIGHTGREEN);
tempColor2 = PegResourceManager::GetColor(CID_GREEN);
tempColor3 = PegResourceManager::GetColor(CID_GREEN);
mID2 = mpChart2->AddLine(tempColor1, tempColor1, tempColor3);
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
PEGINT StripChartWindow::Message(const PegMessage& Mesg)
{
static PEGINT Index = 0, j = 0;
static PEGINT Angle = 0;
switch(Mesg.Type)
{
case PM_SHOW:
PegWindow::Message(Mesg);
SetTimer(1, PEG_ONE_SECOND, 1);
break;
case PM_HIDE:
PegWindow::Message(Mesg);
KillTimer(1);
break;
case PM_TIMER:
{
if(++Index > 17)
{
Index = 0;
}
mpChart->AddData(mID, gChartData[Index]);
if(++j > 28)
{
j = 0;
}
mpChart2->AddData(mID2, gBukData[j]);
if((Angle += 10) > 350)
{
Angle = 0;
}
PEGINT Sin, Cos;
PegLookupSinCos(Angle, &Sin, &Cos);
mpChart->AddData(mSin, (PEGLONG)((Sin * 125) >> 10) + 400);
mpChart2->AddData(mSin2, (PEGLONG)((Cos * 125) >> 10) + 400);
}
default:
{
return(PegWindow::Message(Mesg));
}
}
return 0;
}
void PegAppInitialize(PegPresentationManager *pPresentation)
{
PegRect Rect;
Rect.Set(10, 10, 630, 470);
PegResourceManager::InstallResourcesFromTable(&stchart_ResourceTable);
StripChartWindow* pWindow = new StripChartWindow(Rect, SID_TITLE);
pPresentation->Add(pWindow);
}