|
Can you show your error i cant load your address(jpg)
whitesky
|
|
|
|
|
sure!
take it:
errer C2039:'IDD': Is not a member of 'DigStatic'
error C2065:'IDD':undeclared identifier
SnaidiS(Semion)
|
|
|
|
|
Whats DigStatic CDialog and do you incldue h file and if this isnt your answer can you show your code that has error,please
I see you include #include "Digistatic.h" in digitaldlg.h
wheres class CDigistatic(i think i had like this error already)
whitesky
|
|
|
|
|
In your .h file
you must have deleted the enum
something like this
// Dialog Data
enum { IDD = IDD_MYAPP_DIALOG };
where IDD_MYAPP_DIALOG is a dialog box template
Regards
Abhishake Lahare
|
|
|
|
|
No, I haven't deleted it here is the code:
<br />
<br />
#pragma once<br />
#include "Digistatic.h"<br />
#include "afxwin.h"<br />
<br />
class CDigitalDlg : public CDialog<br />
{<br />
public:<br />
CDigitalDlg(CWnd* pParent = NULL);
<br />
enum { IDD = IDD_DIGITAL_DIALOG };<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
<br />
protected:<br />
HICON m_hIcon;<br />
<br />
virtual BOOL OnInitDialog();<br />
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);<br />
afx_msg void OnPaint();<br />
afx_msg HCURSOR OnQueryDragIcon();<br />
DECLARE_MESSAGE_MAP()<br />
public:<br />
CDigiStatic m_LedText;<br />
};<br />
SnaidiS(Semion)
|
|
|
|
|
The error came from the "DigStatic" class not from the CDigitalDlg. Plz show the header of DigStatic class
nave
|
|
|
|
|
yes my guess is DigStatic
whitesky
|
|
|
|
|
Take:
its a little bit big but ok:
<br />
#if !defined(AFX_DIGISTATIC_H__F77484C2_745F_11D3_A718_87712333104C__INCLUDED_)<br />
#define AFX_DIGISTATIC_H__F77484C2_745F_11D3_A718_87712333104C__INCLUDED_<br />
<br />
#if _MSC_VER >= 1000<br />
#pragma once<br />
#endif // _MSC_VER >= 1000<br />
#include <afxtempl.h><br />
<br />
#include "RGBCOLOR.H"<br />
<br />
class CDoubleRect<br />
{<br />
public:<br />
void SetRect(double x1, double y1, double x2, double y2)<br />
{ left = x1; top = y1; right = x2; bottom = y2;}<br />
double Width() const{return right - left;}<br />
double Height() const{return bottom - top;}<br />
void SetRectEmpty(){left = top = right = bottom = 0.0;}<br />
public:<br />
double left, top, right, bottom; <br />
};<br />
<br />
class CDSegment<br />
{<br />
public:<br />
CDSegment();<br />
CDSegment(const CDSegment& Segment);<br />
~CDSegment();<br />
void DefPoints(const POINT* lpPoints, const BYTE* lpTypes, int nCount);<br />
void Draw(CDC *pDC,const CDoubleRect &DrawPlace, int iWidth) const;<br />
void FreeSegment();<br />
CDSegment operator=(const CDSegment &Segment);<br />
<br />
public:<br />
CPoint * m_paPoints;
BYTE * m_paTypes;
int m_nCount;
};<br />
<br />
typedef CArray< CDSegment, CDSegment> DSegmentArray;<br />
<br />
class CDigiChar<br />
{<br />
public:<br />
CDigiChar();<br />
CDigiChar(const CDigiChar& DigiChar);<br />
<br />
public:<br />
virtual void SetElementData(WORD wSegmData, int iDispStyle);<br />
void Draw(CDC *pDC, const CDoubleRect &DrawPlace, CPen *pOffPen, CPen *pOnPen,<br />
CBrush *pOffBrush, CBrush *pOnBrush, CRgn* region = NULL);<br />
void SetColor(COLORREF OffColor, COLORREF OnColor);<br />
int GetNormWidth() const;<br />
CDigiChar operator=(const CDigiChar &DigiChar);<br />
COLORREF GetColor(void) const { return m_OnColor; }<br />
<br />
protected:<br />
int m_Width;
WORD m_wSegmData;
DSegmentArray m_SegmentArray;
int m_NSegments;
COLORREF m_OffColor;
COLORREF m_OnColor;
BOOL m_bNoOff;
<br />
};<br />
<br />
typedef CArray<CDigiChar, CDigiChar> DigiCharArray;<br />
<br />
<br />
class CDigiStatic : public CStatic<br />
{<br />
public:<br />
CDigiStatic();<br />
<br />
public:<br />
enum {<br />
DS_SMOOTH = 1,
DS_STYLE14 = 2,
DS_SZ_PROP = 4,
DS_NO_OFF = 8,
DS_SOFT = 16
};<br />
<br />
public:<br />
<br />
<br />
public:<br />
virtual ~CDigiStatic();<br />
void SetText(LPCTSTR lpszText);<br />
void Format(LPCTSTR lpszFormat, ...);<br />
void Format(UINT nFormatID, ...);<br />
void SetColor(COLORREF OffColor, COLORREF OnColor);<br />
COLORREF GetOnColor() const {return m_OnColor;}<br />
COLORREF GetOffColor() const {return m_OffColor;}<br />
void SetDrawImmediately(BOOL Enable = TRUE);<br />
COLORREF SetBkColor(COLORREF BackColor = BLACK);<br />
void SetTransparent(BOOL bSet = TRUE);<br />
BOOL ModifyDigiStyle(DWORD dwRemove, DWORD dwAdd);<br />
<br />
protected:<br />
CDigiChar * DefineChar(TCHAR cChar);<br />
void BuildString();<br />
<br />
CString m_strText;
BOOL m_Modified;
DigiCharArray m_CharArray;
COLORREF m_OffColor;
COLORREF m_OnColor;
COLORREF m_BackColor;
DWORD m_DispStyle;
BOOL m_bImmediateUpdate;
BOOL m_bTransparent;
<br />
afx_msg void OnPaint();<br />
afx_msg BOOL OnEraseBkgnd(CDC* pDC);<br />
<br />
DECLARE_MESSAGE_MAP()<br />
<br />
void DoInvalidate();<br />
};<br />
<br />
<br />
<br />
#endif // !defined(AFX_DIGISTATIC_H__F77484C2_745F_11D3_A718_87712333104C__INCLUDED_)<br />
#pragma once<br />
<br />
<br />
<br />
class DigitStatic : public CDialog<br />
{<br />
DECLARE_DYNAMIC(DigitStatic)<br />
<br />
public:<br />
DigitStatic(CWnd* pParent = NULL);
virtual ~DigitStatic();<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
SnaidiS(Semion)
|
|
|
|
|
Semion_N wrote: sure!
take it:
errer C2039:'IDD': Is not a member of 'DigStatic'
error C2065:'IDD':undeclared identifier
where is the "DigStatic" class in the above header?
nave
|
|
|
|
|
<br />
<br />
class CDigiStatic : public CStatic<br />
{<br />
public:<br />
CDigiStatic();<br />
<br />
public:<br />
enum {<br />
DS_SMOOTH = 1,
DS_STYLE14 = 2,
DS_SZ_PROP = 4,
DS_NO_OFF = 8,
DS_SOFT = 16
};<br />
try to look
SnaidiS(Semion)
|
|
|
|
|
ok...but u typed DigStatic not CDigiStatic.
so the above given class is derived from the CStatic. so I think this will be the of the constructor of CDigiStatic.
plz check if the construcor of the CDigiStatic is as given below
CDigiStatic::CDigiStatic()
{
}
if u see IDD in this constructor, try removing it..or plz paste the code of the constructor.... let us check
nave
|
|
|
|
|
here is the DigStatic:
<br />
class DigitStatic : public CDialog<br />
{<br />
DECLARE_DYNAMIC(DigitStatic)<br />
<br />
public:<br />
DigitStatic(CWnd* pParent = NULL);
virtual ~DigitStatic();<br />
<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
You can see there the constructor.
and here is the CDigStatic and you can see there all you want:
<br />
<br />
class CDigiStatic : public CStatic<br />
{<br />
public:<br />
CDigiStatic();<br />
<br />
public:<br />
enum {<br />
DS_SMOOTH = 1,
DS_STYLE14 = 2,
DS_SZ_PROP = 4,
DS_NO_OFF = 8,
DS_SOFT = 16
};<br />
SnaidiS(Semion)
|
|
|
|
|
can u tell me in which statement it shows the error... ?
nave
|
|
|
|
|
Yes,Sure:
Its in the constructor:
<br />
IMPLEMENT_DYNAMIC(DigitStatic, CDialog)<br />
DigitStatic::DigitStatic(CWnd* pParent )<br />
: CDialog(DigitStatic::IDD, pParent)<br />
{<br />
}<br />
SnaidiS(Semion)
|
|
|
|
|
so u DigitStatic is a class create by u..right?
as an alternative try in this way
IMPLEMENT_DYNAMIC(DigitStatic, CDialog)
DigitStatic::DigitStatic(CWnd* pParent /*=NULL*/)
: CDialog(IDC_CUSTOM2 , pParent)
{
}
nave
|
|
|
|
|
No, This class didn't create by me.
I changes it and now it writes:
error C2065:'IDC_CUSTOM2':undeclared identifier
SnaidiS(Semion)
|
|
|
|
|
Semion_N wrote: No, This class didn't create by me.
but i couln't find it in the actuall code i downloaded
Semion_N wrote: :'IDC_CUSTOM2':undeclared identifier
U will be having a dialog in the resource corresponding to the class "DigitStatic"...na? Give the id of that dialog instead of 'IDC_CUSTOM2'
nave
|
|
|
|
|
Naveen R wrote: but i couln't find it in the actuall code i downloaded
It was in the source files I downloaded.
I changed it to "IDD_DIGITAL_DIALOG" but it writes me again that DD_DIGITAL_DIALOG is undeclared identifier.
SnaidiS(Semion)
|
|
|
|
|
try including "resource.h"
nave
|
|
|
|
|
included and it's dont work..
SnaidiS(Semion)
|
|
|
|
|
|
checked,sent.
SnaidiS(Semion)
|
|
|
|
|
Can you show your cpp file (of course not all)
whitesky
|
|
|
|
|
which part do you want?
SnaidiS(Semion)
|
|
|
|
|
I download your program and compile but i dont get any error i guess error is in your cpp file do you check include files
whitesky
|
|
|
|