| | |
EC++ related problem
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2009
Posts: 5
Reputation:
Solved Threads: 0
c++ Syntax (Toggle Plain Text)
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.
Last edited by peter_budo; 18 Days Ago at 8:35 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
•
•
Join Date: Oct 2009
Posts: 5
Reputation:
Solved Threads: 0
0
#3 Oct 13th, 2009
THIS IS THE WHOLE CODE DO PLS HELP ME OUT
c++ Syntax (Toggle Plain Text)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ // 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); }
Last edited by peter_budo; 18 Days Ago at 8:36 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
![]() |
Similar Threads
- Power Problem in Laptop (Cases, Fans and Power Supplies)
- Problem loading up Windows... (Troubleshooting Dead Machines)
- Peculiar power problem (Cases, Fans and Power Supplies)
- A severe problem with programs trying to connect to internet (Web Browsers)
- Two Rather Serious Windows XP Related Problems (Windows NT / 2000 / XP)
- Internet problem: IE doesn't work (Windows NT / 2000 / XP)
- IE graphics problem (Web Browsers)
- IE Refresh problem, startnow.com causing problems (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: file.close
- Next Thread: Hash Table help
| Thread Tools | Search this Thread |
.so 429 ajax api array background bitmap blue c# c++ char char* chatprogramusingobjects class client code codeblocks component compression computer console database delayload desktop development device download dsp email embedded encryption error exam examples file floatingpoint forms fstream function functions game gmail google graph gui hash input insert int introduction java javac jni linker linux lnk2019 math method news node output pong position problem processor program programming python read recursion recursive redhat reformat richedit ruby screen send stop string struct superclass syntax system template test text textfield timer tree url vector virus vista visual web win32 win32api windows xml xwnidow







