Click here to Skip to main content
15,904,415 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralChange Mouse Cursor Pin
nelzanoide26-Dec-02 0:20
nelzanoide26-Dec-02 0:20 
GeneralRe: Change Mouse Cursor Pin
Joaquín M López Muñoz26-Dec-02 3:58
Joaquín M López Muñoz26-Dec-02 3:58 
GeneralRe: Change Mouse Cursor Pin
nelzanoide26-Dec-02 4:09
nelzanoide26-Dec-02 4:09 
GeneralCArray woes Pin
raner25-Dec-02 23:05
raner25-Dec-02 23:05 
GeneralRe: CArray woes Pin
KaЯl25-Dec-02 23:24
KaЯl25-Dec-02 23:24 
GeneralRe: CArray woes Pin
raner26-Dec-02 7:00
raner26-Dec-02 7:00 
GeneralRe: CArray woes Pin
KaЯl26-Dec-02 7:26
KaЯl26-Dec-02 7:26 
GeneralRe: CArray woes Pin
raner26-Dec-02 22:21
raner26-Dec-02 22:21 
Hi..i've tried the following but it's still not working.Do you know wat i shld do?

-------------------------------------------------------------------
typedef CArray <srawdata *,="" srawdata="" *=""> CSRawDataArray;//outside class declaration

//in doc header
CSRawDataArray m_array1;
CSRawDataArray& GetRawDataArray() const;

//in doc source file
//doing 2 things here.(1)load data into array from text file (2)define get function

void CRainAttDoc::Serialize(CArchive& ar)
{
CString strOneLine;

while(ar.ReadString(strOneLine))
{
SRawData *pData = new SRawData;
sscanf(strOneLine,"%g%g\n",pData->x,pData->y);
m_array1.Add(pData);
}
}

CSRawDataArray &CRainAttDoc::GetRawDataArray() const
{
return m_array1;
}
---------------------------------------------------------------------
This gives me the following error:
error C2440: 'return' : cannot convert from 'const class CArray<struct srawdata="" *,struct="" *="">' to 'class CArray<struct srawdata="" *,struct="" *=""> &'

When i try to change the object declaration to this:

const CSRawDataArray m_array1;

error C2440 remains and on top of that, the following message for RemoveAll() and Add()

'RemoveAll' : cannot convert 'this' pointer from 'const class CArray<struct srawdata="" *,struct="" *="">' to 'class CArray<struct srawdata="" *,struct="" *=""> &'

I was trying to declare the function const so that other classes cant alter the value as suggested by Roman Fadeyev but it just cant work.I'm pulling my hair out!..haa thks alot for your help.
GeneralRe: CArray woes Pin
KaЯl26-Dec-02 22:36
KaЯl26-Dec-02 22:36 
GeneralRe: CArray woes Pin
raner26-Dec-02 22:49
raner26-Dec-02 22:49 
GeneralRe: CArray woes Pin
KaЯl26-Dec-02 23:20
KaЯl26-Dec-02 23:20 
GeneralRe: CArray woes Pin
raner27-Dec-02 5:06
raner27-Dec-02 5:06 
GeneralRe: CArray woes Pin
KaЯl27-Dec-02 5:13
KaЯl27-Dec-02 5:13 
GeneralRe: CArray woes Pin
raner27-Dec-02 6:22
raner27-Dec-02 6:22 
GeneralRe: CArray woes Pin
KaЯl27-Dec-02 12:47
KaЯl27-Dec-02 12:47 
GeneralRe: CArray woes Pin
Roman Fadeyev26-Dec-02 0:05
Roman Fadeyev26-Dec-02 0:05 
GeneralRe: CArray woes Pin
raner26-Dec-02 6:38
raner26-Dec-02 6:38 
GeneralRe: CArray woes Pin
Christian Graus26-Dec-02 0:11
protectorChristian Graus26-Dec-02 0:11 
GeneralRe: CArray woes Pin
User 665826-Dec-02 0:41
User 665826-Dec-02 0:41 
GeneralRe: CArray woes Pin
Christian Graus26-Dec-02 0:47
protectorChristian Graus26-Dec-02 0:47 
GeneralRe: CArray woes Pin
User 665826-Dec-02 2:49
User 665826-Dec-02 2:49 
GeneralRe: CArray woes Pin
Christian Graus26-Dec-02 10:12
protectorChristian Graus26-Dec-02 10:12 
GeneralMMC tutorial required Pin
FASTian25-Dec-02 22:48
FASTian25-Dec-02 22:48 
Generalediting a menu Pin
citroen25-Dec-02 22:46
citroen25-Dec-02 22:46 
GeneralAdding WTL controls to MFC projects Pin
Hockey25-Dec-02 21:39
Hockey25-Dec-02 21:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.