meow00
asked on
Spinner class ... multitasking ...
Hi Experts,
This is actually a following up question of
https://www.experts-exchange.com/questions/20886870/VC-running-an-appliaction.html
https://www.experts-exchange.com/questions/20887204/VC-no-matching-symbolic-information-found.html
I have got suggestions from experts, but I am still unable to make the code work after a lot of struggling !!! (even though it is successfully compiled). If it runs successfully, we should see a wheel spinning ......
Anyway, I post all the header and source files of this project : "Tasking" as follows. I would appreciate if anyone can take a look, let me know how to fix it and make it work !!!
Thanks very very much !!!
-------------------------- ---------- --
Project : Tasking
Source files : Tasking.cpp Tasking.rc TaskingDoc.cpp TaskingView.cpp Spinner.cpp MainFrm.cpp StdAfx.cpp
Header files : Tasking.h Resource.h TaskingDoc.h TaskingView.h Spinner.h MainFrm.h StdAfx.h
-------------------------- ---------- --
// Tasking.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Tasking.h"
#include "MainFrm.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#include "Spinner.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingApp
BEGIN_MESSAGE_MAP(CTasking App, CWinApp)
//{{AFX_MSG_MAP(CTaskingAp p)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingApp construction
CTaskingApp::CTaskingApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// The one and only CTaskingApp object
CTaskingApp theApp;
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingApp initialization
BOOL CTaskingApp::InitInstance( )
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTaskingDoc) ,
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CTaskingView ));
AddDocTemplate(pDocTemplat e);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI nfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_ SHOW);
m_pMainWnd->UpdateWindow() ;
return TRUE;
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchan ge* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDl g)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange( CDataExcha nge* pDX)
{
CDialog::DoDataExchange(pD X);
//{{AFX_DATA_MAP(CAboutDlg )
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDl g, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CTaskingApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingApp message handlers
BOOL CTaskingApp::OnIdle(LONG lCount)
{
// TODO: Add your specialized code here and/or call the base class
POSITION pos = GetFirstDocTemplatePositio n() ;
if(pos)
{
CDocTemplate* pDocTemp = GetNextDocTemplate(pos) ;
if(pDocTemp)
{
POSITION dPos = pDocTemp -> GetFirstDocPosition() ;
if(dPos)
{
CTaskingDoc* pDocWnd =
(CTaskingDoc*)pDocTemp -> GetNextDoc(dPos) ;
if(pDocWnd)
{
POSITION vPos = pDocWnd -> GetFirstViewPosition() ;
if(vPos)
{
CTaskingView* pView =
(CTaskingView*)pDocWnd -> GetNextView(vPos) ;
if(pView)
{
if(pView-> m_bOnIdle1)
pDocWnd -> DoSpin(0) ;
if(pView-> m_bOnIdle2)
pDocWnd -> DoSpin(2) ;
}
}
}
}
}
}
return CWinApp::OnIdle(lCount);
}
-------------------------- ---------- ---------- --------
// TaskingDoc.cpp : implementation of the CTaskingDoc class
//
#include "stdafx.h"
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingDoc
IMPLEMENT_DYNCREATE(CTaski ngDoc, CDocument)
BEGIN_MESSAGE_MAP(CTasking Doc, CDocument)
//{{AFX_MSG_MAP(CTaskingDo c)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingDoc construction/destruction
CTaskingDoc::CTaskingDoc()
{
// TODO: add one-time construction code here
}
CTaskingDoc::~CTaskingDoc( )
{
}
BOOL CTaskingDoc::OnNewDocument ()
{
if (!CDocument::OnNewDocument ())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
InitSpinners() ;
return TRUE;
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingDoc serialization
void CTaskingDoc::Serialize(CAr chive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingDoc diagnostics
#ifdef _DEBUG
void CTaskingDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CTaskingDoc::Dump(CDumpCon text& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingDoc commands
void CTaskingDoc::CalcPoint(int nID, CSpinner *pSpin)
{
RECT lWndRect ;
CPoint pPos ;
int iLength ;
CTaskingView *pWnd ;
pWnd = (CTaskingView*)pSpin -> GetViewWnd() ;
pWnd -> GetClientRect(&lWndRect) ;
iLength = lWndRect.right/6 ;
switch(nID)
{
case 0:
pPos.x = (lWndRect.right/4)-iLength ;
pPos.y = (lWndRect.bottom/4) - iLength ;
break ;
case 1:
pPos.x = ((lWndRect.right/4)*3) - iLength ;
pPos.y = (lWndRect.bottom/4) - iLength ;
break ;
case 2:
pPos.x = (lWndRect.right/4) - iLength ;
pPos.y = ((lWndRect.bottom/4)*3) -(long)(iLength*1.25) ;
break ;
case 3:
pPos.x = ((lWndRect.right/4)*3) - iLength ;
pPos.y = ((lWndRect.bottom/4)*3) - (long)(iLength*1.25) ;
break ;
}
pSpin -> SetLength(iLength) ;
pSpin -> SetPoint(pPos) ;
}
void CTaskingDoc::InitSpinners( )
{
int i;
POSITION pos = GetFirstViewPosition() ;
if(pos!= NULL)
{
CView* pView = GetNextView(pos) ;
for(i=0; i<4; i++)
{
m_cSpin[i].SetViewWnd(pVie w) ;
m_cSpin[i].SetContinue(NUL L) ;
switch(i)
{
case 1:
m_cSpin[i].SetContinue(&(( CTaskingVi ew*)pView) -> m_bThread1) ;
break ;
case 3:
m_cSpin[i].SetContinue(&(( CTaskingVi ew*)pView) -> m_bThread2) ;
break ;
}
CalcPoint(i, &m_cSpin[i]) ;
}
}
}
void CTaskingDoc::DoSpin(int Index)
{
m_cSpin[nIndex].Draw() ;
}
-------------------------- ---------- ---------- ------
// TaskingView.cpp : implementation of the CTaskingView class
//
#include "stdafx.h"
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingView
IMPLEMENT_DYNCREATE(CTaski ngView, CFormView)
BEGIN_MESSAGE_MAP(CTasking View, CFormView)
//{{AFX_MSG_MAP(CTaskingVi ew)
ON_BN_CLICKED(IDC_CBONIDLE 1, OnCbonidle1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingView construction/destruction
CTaskingView::CTaskingView ()
: CFormView(CTaskingView::ID D)
{
//{{AFX_DATA_INIT(CTasking View)
m_bOnIdle1 = FALSE;
m_bOnIdle2 = FALSE;
m_bThread1 = FALSE;
m_bThread2 = FALSE;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CTaskingView::~CTaskingVie w()
{
}
void CTaskingView::DoDataExchan ge(CDataEx change* pDX)
{
CFormView::DoDataExchange( pDX);
//{{AFX_DATA_MAP(CTaskingV iew)
DDX_Check(pDX, IDC_CBONIDLE1, m_bOnIdle1);
DDX_Check(pDX, IDC_CBONIDLE2, m_bOnIdle2);
DDX_Check(pDX, IDC_CBTHREAD1, m_bThread1);
DDX_Check(pDX, IDC_CBTHREAD2, m_bThread2);
//}}AFX_DATA_MAP
}
BOOL CTaskingView::PreCreateWin dow(CREATE STRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow (cs);
}
void CTaskingView::OnInitialUpd ate()
{
CFormView::OnInitialUpdate ();
GetParentFrame()->RecalcLa yout();
ResizeParentToFit();
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingView diagnostics
#ifdef _DEBUG
void CTaskingView::AssertValid( ) const
{
CFormView::AssertValid();
}
void CTaskingView::Dump(CDumpCo ntext& dc) const
{
CFormView::Dump(dc);
}
CTaskingDoc* CTaskingView::GetDocument( ) // non-debug version is inline
{
ASSERT(m_pDocument->IsKind Of(RUNTIME _CLASS(CTa skingDoc)) );
return (CTaskingDoc*)m_pDocument;
}
#endif //_DEBUG
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingView message handlers
void CTaskingView::OnCbonidle1( )
{
// TODO: Add your control notification handler code here
UpdateData(TRUE) ;
}
-------------------------- ---------- ---------- ----
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "Tasking.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CMainFrame
IMPLEMENT_DYNCREATE(CMainF rame, CFrameWnd)
BEGIN_MESSAGE_MAP(CMainFra me, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame )
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
BOOL CMainFrame::PreCreateWindo w(CREATEST RUCT& cs)
{
if( !CFrameWnd::PreCreateWindo w(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpCont ext& dc) const
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CMainFrame message handlers
-------------------------- ---------- ---------- ---------- ---------
// Spinner.cpp: implementation of the CSpinner class.
//
////////////////////////// ////////// ////////// ////////// ////////// ////
#include "stdafx.h"
#include <math.h>
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingView.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
COLORREF CSpinner::m_crColors[8] ={
RGB(0,0,0),
RGB(0,0,255),
RGB(0,255,0),
RGB(0,255,255),
RGB(255,0,0),
RGB(255,0,255),
RGB(255,255,0),
RGB(255,255,255)
} ;
////////////////////////// ////////// ////////// ////////// ////////// ////
// Construction/Destruction
////////////////////////// ////////// ////////// ////////// ////////// ////
CSpinner::CSpinner()
{
m_iRadius = 0 ;
m_nMinute = 0 ;
m_crColor = 0 ;
m_pViewWnd = NULL ;
m_bContinue = NULL ;
}
CSpinner::~CSpinner()
{
}
void CSpinner::Draw()
{
// CTaskingView* pView = NULL ;
// this->SetViewWnd(pView) ;
// m_pViewWnd -> SetViewWnd() ;
CDC *pDC = m_pViewWnd->GetDC() ;
pDC-> SetMapMode(MM_LOENGLISH) ;
CPoint org = m_pCenter ;
CPoint pStartPoint ;
pStartPoint.x = (m_iRadius /2) ;
pStartPoint.y = (m_iRadius /2 ) ;
org.x = m_pCenter.x + (m_iRadius/2) ;
org.y = m_pCenter.y + m_iRadius ;
pDC-> SetViewportOrg(org.x, org.y) ;
CPoint pEndPoint ;
double nRadians = (double) (m_nMinute*6) * 0.174532932 ;
pEndPoint.x = (int)(m_iRadius * sin(nRadians)) ;
pEndPoint.y = (int)(m_iRadius * cos(nRadians)) ;
CPen pen(PS_SOLID, 0, m_crColors[m_crColor]) ;
CPen* pOldPen = pDC -> SelectObject(&pen) ;
pDC->MoveTo(pEndPoint) ;
pDC->LineTo(pStartPoint) ;
pDC->SelectObject(&pOldPen ) ;
m_pViewWnd->ReleaseDC(pDC) ;
if(++m_nMinute == 60)
{
m_nMinute = 0 ;
if(++m_crColor == 8) m_crColor = 0 ;
}
}
-------------------------- --------
// stdafx.cpp : source file that includes just the standard includes
// Tasking.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
-------------------------- ---------- ---------- --------
-------------------------- ---------- ---------- ---------
// MainFrm.h : interface of the CMainFrame class
//
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
#if !defined(AFX_MAINFRM_H__AE B7B57B_AFE D_4072_824 9_C4D998A4 4188__INCL UDED_)
#define AFX_MAINFRM_H__AEB7B57B_AF ED_4072_82 49_C4D998A 44188__INC LUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFra me)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame )
virtual BOOL PreCreateWindow(CREATESTRU CT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__AE B7B57B_AFE D_4072_824 9_C4D998A4 4188__INCL UDED_)
-------------------------- ----
// Resource.h
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Tasking.rc
//
#define IDD_ABOUTBOX 100
#define IDD_TASKING_FORM 101
#define IDR_MAINFRAME 128
#define IDR_TASKINTYPE 129
#define IDC_CBONIDLE1 1000
#define IDC_CBTHREAD1 1001
#define IDC_CBONIDLE2 1002
#define IDC_CBTHREAD2 1003
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-------------------------- --
// Spinner.h: interface for the CSpinner class.
//
////////////////////////// ////////// ////////// ////////// ////////// ////
#if !defined(AFX_SPINNER_H__BE 690C80_FBE B_4D2B_8FA 0_3652C4AF 0B86__INCL UDED_)
#define AFX_SPINNER_H__BE690C80_FB EB_4D2B_8F A0_3652C4A F0B86__INC LUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CSpinner : public CObject
{
public:
void Draw();
BOOL* GetContinue(){ return m_bContinue ;}
void SetContinue(BOOL* bContinue){ m_bContinue = bContinue ;}
CWnd* GetViewWnd() { return m_pViewWnd ;}
void SetViewWnd(CWnd* pWnd){ m_pViewWnd = pWnd ;}
void SetLength(int iLength) {m_iRadius = iLength ;}
void SetPoint(CPoint pPoint){m_pCenter = pPoint ;}
CSpinner();
virtual ~CSpinner();
private:
BOOL* m_bContinue;
public:
CWnd* m_pViewWnd;
private:
static COLORREF m_crColors[8];
CPoint m_pCenter;
int m_iRadius;
int m_nMinute;
int m_crColor;
};
#endif // !defined(AFX_SPINNER_H__BE 690C80_FBE B_4D2B_8FA 0_3652C4AF 0B86__INCL UDED_)
-------------------------- --
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__D41 8A5AC_2FC7 _46F4_9329 _AA7DB3DAF 6E6__INCLU DED_)
#define AFX_STDAFX_H__D418A5AC_2FC 7_46F4_932 9_AA7DB3DA F6E6__INCL UDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__D41 8A5AC_2FC7 _46F4_9329 _AA7DB3DAF 6E6__INCLU DED_)
-------------------------- -------
// Tasking.h : main header file for the TASKING application
//
#if !defined(AFX_TASKING_H__E2 949A92_3A5 A_4AFE_A8F 6_A337CB77 3091__INCL UDED_)
#define AFX_TASKING_H__E2949A92_3A 5A_4AFE_A8 F6_A337CB7 73091__INC LUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
// CTaskingApp:
// See Tasking.cpp for the implementation of this class
//
class CTaskingApp : public CWinApp
{
public:
CTaskingApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingAp p)
public:
virtual BOOL InitInstance();
virtual BOOL OnIdle(LONG lCount);
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CTaskingApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKING_H__E2 949A92_3A5 A_4AFE_A8F 6_A337CB77 3091__INCL UDED_)
-----------------
// TaskingDoc.h : interface of the CTaskingDoc class
//
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
#include "Spinner.h"
#if !defined(AFX_TASKINGDOC_H_ _AE6B262B_ 212D_4A77_ 8B09_B05BD 6B73007__I NCLUDED_)
#define AFX_TASKINGDOC_H__AE6B262B _212D_4A77 _8B09_B05B D6B73007__ INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTaskingDoc : public CDocument
{
protected: // create from serialization only
CTaskingDoc();
DECLARE_DYNCREATE(CTasking Doc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingDo c)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
void DoSpin(int Index);
virtual ~CTaskingDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CTaskingDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int nIndex;
CSpinner m_cSpin[4];
void InitSpinners();
void CalcPoint(int nID, CSpinner *pSpin);
};
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKINGDOC_H_ _AE6B262B_ 212D_4A77_ 8B09_B05BD 6B73007__I NCLUDED_)
---------------------
// TaskingView.h : interface of the CTaskingView class
//
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
#include "TaskingDoc.h"
#if !defined(AFX_TASKINGVIEW_H __A3EB23A0 _DD4D_494D _92BB_27B1 F7685AEE__ INCLUDED_)
#define AFX_TASKINGVIEW_H__A3EB23A 0_DD4D_494 D_92BB_27B 1F7685AEE_ _INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTaskingView : public CFormView
{
protected: // create from serialization only
CTaskingView();
DECLARE_DYNCREATE(CTasking View)
public:
//{{AFX_DATA(CTaskingView)
enum { IDD = IDD_TASKING_FORM };
BOOL m_bOnIdle1;
BOOL m_bOnIdle2;
BOOL m_bThread1;
BOOL m_bThread2;
//}}AFX_DATA
// Attributes
public:
CTaskingDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingVi ew)
public:
virtual BOOL PreCreateWindow(CREATESTRU CT& cs);
protected:
virtual void DoDataExchange(CDataExchan ge* pDX); // DDX/DDV support
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTaskingView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CTaskingView)
afx_msg void OnCbonidle1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in TaskingView.cpp
inline CTaskingDoc* CTaskingView::GetDocument( )
{ return (CTaskingDoc*)m_pDocument; }
#endif
////////////////////////// ////////// ////////// ////////// ////////// ////////// /
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKINGVIEW_H __A3EB23A0 _DD4D_494D _92BB_27B1 F7685AEE__ INCLUDED_)
This is actually a following up question of
https://www.experts-exchange.com/questions/20886870/VC-running-an-appliaction.html
https://www.experts-exchange.com/questions/20887204/VC-no-matching-symbolic-information-found.html
I have got suggestions from experts, but I am still unable to make the code work after a lot of struggling !!! (even though it is successfully compiled). If it runs successfully, we should see a wheel spinning ......
Anyway, I post all the header and source files of this project : "Tasking" as follows. I would appreciate if anyone can take a look, let me know how to fix it and make it work !!!
Thanks very very much !!!
--------------------------
Project : Tasking
Source files : Tasking.cpp Tasking.rc TaskingDoc.cpp TaskingView.cpp Spinner.cpp MainFrm.cpp StdAfx.cpp
Header files : Tasking.h Resource.h TaskingDoc.h TaskingView.h Spinner.h MainFrm.h StdAfx.h
--------------------------
// Tasking.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Tasking.h"
#include "MainFrm.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#include "Spinner.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////
// CTaskingApp
BEGIN_MESSAGE_MAP(CTasking
//{{AFX_MSG_MAP(CTaskingAp
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
//////////////////////////
// CTaskingApp construction
CTaskingApp::CTaskingApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
//////////////////////////
// The one and only CTaskingApp object
CTaskingApp theApp;
//////////////////////////
// CTaskingApp initialization
BOOL CTaskingApp::InitInstance(
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTaskingDoc)
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTaskingView
AddDocTemplate(pDocTemplat
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_
m_pMainWnd->UpdateWindow()
return TRUE;
}
//////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchan
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDl
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(
{
CDialog::DoDataExchange(pD
//{{AFX_DATA_MAP(CAboutDlg
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDl
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CTaskingApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
//////////////////////////
// CTaskingApp message handlers
BOOL CTaskingApp::OnIdle(LONG lCount)
{
// TODO: Add your specialized code here and/or call the base class
POSITION pos = GetFirstDocTemplatePositio
if(pos)
{
CDocTemplate* pDocTemp = GetNextDocTemplate(pos) ;
if(pDocTemp)
{
POSITION dPos = pDocTemp -> GetFirstDocPosition() ;
if(dPos)
{
CTaskingDoc* pDocWnd =
(CTaskingDoc*)pDocTemp -> GetNextDoc(dPos) ;
if(pDocWnd)
{
POSITION vPos = pDocWnd -> GetFirstViewPosition() ;
if(vPos)
{
CTaskingView* pView =
(CTaskingView*)pDocWnd -> GetNextView(vPos) ;
if(pView)
{
if(pView-> m_bOnIdle1)
pDocWnd -> DoSpin(0) ;
if(pView-> m_bOnIdle2)
pDocWnd -> DoSpin(2) ;
}
}
}
}
}
}
return CWinApp::OnIdle(lCount);
}
--------------------------
// TaskingDoc.cpp : implementation of the CTaskingDoc class
//
#include "stdafx.h"
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////
// CTaskingDoc
IMPLEMENT_DYNCREATE(CTaski
BEGIN_MESSAGE_MAP(CTasking
//{{AFX_MSG_MAP(CTaskingDo
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////
// CTaskingDoc construction/destruction
CTaskingDoc::CTaskingDoc()
{
// TODO: add one-time construction code here
}
CTaskingDoc::~CTaskingDoc(
{
}
BOOL CTaskingDoc::OnNewDocument
{
if (!CDocument::OnNewDocument
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
InitSpinners() ;
return TRUE;
}
//////////////////////////
// CTaskingDoc serialization
void CTaskingDoc::Serialize(CAr
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
//////////////////////////
// CTaskingDoc diagnostics
#ifdef _DEBUG
void CTaskingDoc::AssertValid()
{
CDocument::AssertValid();
}
void CTaskingDoc::Dump(CDumpCon
{
CDocument::Dump(dc);
}
#endif //_DEBUG
//////////////////////////
// CTaskingDoc commands
void CTaskingDoc::CalcPoint(int
{
RECT lWndRect ;
CPoint pPos ;
int iLength ;
CTaskingView *pWnd ;
pWnd = (CTaskingView*)pSpin -> GetViewWnd() ;
pWnd -> GetClientRect(&lWndRect) ;
iLength = lWndRect.right/6 ;
switch(nID)
{
case 0:
pPos.x = (lWndRect.right/4)-iLength
pPos.y = (lWndRect.bottom/4) - iLength ;
break ;
case 1:
pPos.x = ((lWndRect.right/4)*3) - iLength ;
pPos.y = (lWndRect.bottom/4) - iLength ;
break ;
case 2:
pPos.x = (lWndRect.right/4) - iLength ;
pPos.y = ((lWndRect.bottom/4)*3) -(long)(iLength*1.25) ;
break ;
case 3:
pPos.x = ((lWndRect.right/4)*3) - iLength ;
pPos.y = ((lWndRect.bottom/4)*3) - (long)(iLength*1.25) ;
break ;
}
pSpin -> SetLength(iLength) ;
pSpin -> SetPoint(pPos) ;
}
void CTaskingDoc::InitSpinners(
{
int i;
POSITION pos = GetFirstViewPosition() ;
if(pos!= NULL)
{
CView* pView = GetNextView(pos) ;
for(i=0; i<4; i++)
{
m_cSpin[i].SetViewWnd(pVie
m_cSpin[i].SetContinue(NUL
switch(i)
{
case 1:
m_cSpin[i].SetContinue(&((
break ;
case 3:
m_cSpin[i].SetContinue(&((
break ;
}
CalcPoint(i, &m_cSpin[i]) ;
}
}
}
void CTaskingDoc::DoSpin(int Index)
{
m_cSpin[nIndex].Draw() ;
}
--------------------------
// TaskingView.cpp : implementation of the CTaskingView class
//
#include "stdafx.h"
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingDoc.h"
#include "TaskingView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////
// CTaskingView
IMPLEMENT_DYNCREATE(CTaski
BEGIN_MESSAGE_MAP(CTasking
//{{AFX_MSG_MAP(CTaskingVi
ON_BN_CLICKED(IDC_CBONIDLE
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////
// CTaskingView construction/destruction
CTaskingView::CTaskingView
: CFormView(CTaskingView::ID
{
//{{AFX_DATA_INIT(CTasking
m_bOnIdle1 = FALSE;
m_bOnIdle2 = FALSE;
m_bThread1 = FALSE;
m_bThread2 = FALSE;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CTaskingView::~CTaskingVie
{
}
void CTaskingView::DoDataExchan
{
CFormView::DoDataExchange(
//{{AFX_DATA_MAP(CTaskingV
DDX_Check(pDX, IDC_CBONIDLE1, m_bOnIdle1);
DDX_Check(pDX, IDC_CBONIDLE2, m_bOnIdle2);
DDX_Check(pDX, IDC_CBTHREAD1, m_bThread1);
DDX_Check(pDX, IDC_CBTHREAD2, m_bThread2);
//}}AFX_DATA_MAP
}
BOOL CTaskingView::PreCreateWin
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CFormView::PreCreateWindow
}
void CTaskingView::OnInitialUpd
{
CFormView::OnInitialUpdate
GetParentFrame()->RecalcLa
ResizeParentToFit();
}
//////////////////////////
// CTaskingView diagnostics
#ifdef _DEBUG
void CTaskingView::AssertValid(
{
CFormView::AssertValid();
}
void CTaskingView::Dump(CDumpCo
{
CFormView::Dump(dc);
}
CTaskingDoc* CTaskingView::GetDocument(
{
ASSERT(m_pDocument->IsKind
return (CTaskingDoc*)m_pDocument;
}
#endif //_DEBUG
//////////////////////////
// CTaskingView message handlers
void CTaskingView::OnCbonidle1(
{
// TODO: Add your control notification handler code here
UpdateData(TRUE) ;
}
--------------------------
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "Tasking.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////
// CMainFrame
IMPLEMENT_DYNCREATE(CMainF
BEGIN_MESSAGE_MAP(CMainFra
//{{AFX_MSG_MAP(CMainFrame
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
BOOL CMainFrame::PreCreateWindo
{
if( !CFrameWnd::PreCreateWindo
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
//////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpCont
{
CFrameWnd::Dump(dc);
}
#endif //_DEBUG
//////////////////////////
// CMainFrame message handlers
--------------------------
// Spinner.cpp: implementation of the CSpinner class.
//
//////////////////////////
#include "stdafx.h"
#include <math.h>
#include "Tasking.h"
#include "Spinner.h"
#include "TaskingView.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
COLORREF CSpinner::m_crColors[8] ={
RGB(0,0,0),
RGB(0,0,255),
RGB(0,255,0),
RGB(0,255,255),
RGB(255,0,0),
RGB(255,0,255),
RGB(255,255,0),
RGB(255,255,255)
} ;
//////////////////////////
// Construction/Destruction
//////////////////////////
CSpinner::CSpinner()
{
m_iRadius = 0 ;
m_nMinute = 0 ;
m_crColor = 0 ;
m_pViewWnd = NULL ;
m_bContinue = NULL ;
}
CSpinner::~CSpinner()
{
}
void CSpinner::Draw()
{
// CTaskingView* pView = NULL ;
// this->SetViewWnd(pView) ;
// m_pViewWnd -> SetViewWnd() ;
CDC *pDC = m_pViewWnd->GetDC() ;
pDC-> SetMapMode(MM_LOENGLISH) ;
CPoint org = m_pCenter ;
CPoint pStartPoint ;
pStartPoint.x = (m_iRadius /2) ;
pStartPoint.y = (m_iRadius /2 ) ;
org.x = m_pCenter.x + (m_iRadius/2) ;
org.y = m_pCenter.y + m_iRadius ;
pDC-> SetViewportOrg(org.x, org.y) ;
CPoint pEndPoint ;
double nRadians = (double) (m_nMinute*6) * 0.174532932 ;
pEndPoint.x = (int)(m_iRadius * sin(nRadians)) ;
pEndPoint.y = (int)(m_iRadius * cos(nRadians)) ;
CPen pen(PS_SOLID, 0, m_crColors[m_crColor]) ;
CPen* pOldPen = pDC -> SelectObject(&pen) ;
pDC->MoveTo(pEndPoint) ;
pDC->LineTo(pStartPoint) ;
pDC->SelectObject(&pOldPen
m_pViewWnd->ReleaseDC(pDC)
if(++m_nMinute == 60)
{
m_nMinute = 0 ;
if(++m_crColor == 8) m_crColor = 0 ;
}
}
--------------------------
// stdafx.cpp : source file that includes just the standard includes
// Tasking.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
--------------------------
--------------------------
// MainFrm.h : interface of the CMainFrame class
//
//////////////////////////
#if !defined(AFX_MAINFRM_H__AE
#define AFX_MAINFRM_H__AEB7B57B_AF
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFra
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame
virtual BOOL PreCreateWindow(CREATESTRU
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__AE
--------------------------
// Resource.h
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Tasking.rc
//
#define IDD_ABOUTBOX 100
#define IDD_TASKING_FORM 101
#define IDR_MAINFRAME 128
#define IDR_TASKINTYPE 129
#define IDC_CBONIDLE1 1000
#define IDC_CBTHREAD1 1001
#define IDC_CBONIDLE2 1002
#define IDC_CBTHREAD2 1003
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
--------------------------
// Spinner.h: interface for the CSpinner class.
//
//////////////////////////
#if !defined(AFX_SPINNER_H__BE
#define AFX_SPINNER_H__BE690C80_FB
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CSpinner : public CObject
{
public:
void Draw();
BOOL* GetContinue(){ return m_bContinue ;}
void SetContinue(BOOL* bContinue){ m_bContinue = bContinue ;}
CWnd* GetViewWnd() { return m_pViewWnd ;}
void SetViewWnd(CWnd* pWnd){ m_pViewWnd = pWnd ;}
void SetLength(int iLength) {m_iRadius = iLength ;}
void SetPoint(CPoint pPoint){m_pCenter = pPoint ;}
CSpinner();
virtual ~CSpinner();
private:
BOOL* m_bContinue;
public:
CWnd* m_pViewWnd;
private:
static COLORREF m_crColors[8];
CPoint m_pCenter;
int m_iRadius;
int m_nMinute;
int m_crColor;
};
#endif // !defined(AFX_SPINNER_H__BE
--------------------------
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__D41
#define AFX_STDAFX_H__D418A5AC_2FC
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__D41
--------------------------
// Tasking.h : main header file for the TASKING application
//
#if !defined(AFX_TASKING_H__E2
#define AFX_TASKING_H__E2949A92_3A
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
//////////////////////////
// CTaskingApp:
// See Tasking.cpp for the implementation of this class
//
class CTaskingApp : public CWinApp
{
public:
CTaskingApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingAp
public:
virtual BOOL InitInstance();
virtual BOOL OnIdle(LONG lCount);
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CTaskingApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKING_H__E2
-----------------
// TaskingDoc.h : interface of the CTaskingDoc class
//
//////////////////////////
#include "Spinner.h"
#if !defined(AFX_TASKINGDOC_H_
#define AFX_TASKINGDOC_H__AE6B262B
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTaskingDoc : public CDocument
{
protected: // create from serialization only
CTaskingDoc();
DECLARE_DYNCREATE(CTasking
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingDo
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
void DoSpin(int Index);
virtual ~CTaskingDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CTaskingDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int nIndex;
CSpinner m_cSpin[4];
void InitSpinners();
void CalcPoint(int nID, CSpinner *pSpin);
};
//////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKINGDOC_H_
---------------------
// TaskingView.h : interface of the CTaskingView class
//
//////////////////////////
#include "TaskingDoc.h"
#if !defined(AFX_TASKINGVIEW_H
#define AFX_TASKINGVIEW_H__A3EB23A
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CTaskingView : public CFormView
{
protected: // create from serialization only
CTaskingView();
DECLARE_DYNCREATE(CTasking
public:
//{{AFX_DATA(CTaskingView)
enum { IDD = IDD_TASKING_FORM };
BOOL m_bOnIdle1;
BOOL m_bOnIdle2;
BOOL m_bThread1;
BOOL m_bThread2;
//}}AFX_DATA
// Attributes
public:
CTaskingDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTaskingVi
public:
virtual BOOL PreCreateWindow(CREATESTRU
protected:
virtual void DoDataExchange(CDataExchan
virtual void OnInitialUpdate(); // called first time after construct
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTaskingView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CTaskingView)
afx_msg void OnCbonidle1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in TaskingView.cpp
inline CTaskingDoc* CTaskingView::GetDocument(
{ return (CTaskingDoc*)m_pDocument;
#endif
//////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TASKINGVIEW_H
Hi meow00,
If you don't mind please send me the zipped source code to lakshmanan_ce@yahoo.co.in
Regards,
Lakshman
If you don't mind please send me the zipped source code to lakshmanan_ce@yahoo.co.in
Regards,
Lakshman
>> If you don't mind please send me the zipped source code to lakshmanan_ce@yahoo.co.in
That is against EE policy.
That is against EE policy.
Hi mrwad99,
I am sorry for my earlier comment.
I am not aware that it is against EE policy.
Thanks,
Lakshman
I am sorry for my earlier comment.
I am not aware that it is against EE policy.
Thanks,
Lakshman
No problem. It is just that it is fairer no everyone if the questioner posts a link to his code then anyone can downloasd it you see :)
ASKER
Hi Experts,
The zip file of the whole project is now at :
http://www.geocities.com/hello_meow00/
Any help is highly appreciated !!!
meow .......
Heh, nice one. You might actually want to strip all of the stuff out of the debug folder and just put the source files there; people on slower connections will appreciate it more :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks drelectro !!! It really helps !
It would be so much easier if you posted a link to the VC++ project that you would upload, then people could download it and play with it straight away.
If you could do that please then it will help everyone a lot !
Cheers.