Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDLL into the Activex Project Pin
ashishbhatt5-Nov-07 23:19
ashishbhatt5-Nov-07 23:19 
QuestionTo get HICON Pin
KASR15-Nov-07 23:14
KASR15-Nov-07 23:14 
AnswerRe: To get HICON Pin
Nelek5-Nov-07 23:30
protectorNelek5-Nov-07 23:30 
AnswerRe: To get HICON Pin
Hamid_RT5-Nov-07 23:52
Hamid_RT5-Nov-07 23:52 
Questionhow to initialize a form? Pin
panthal5-Nov-07 23:13
panthal5-Nov-07 23:13 
AnswerRe: how to initialize a form? Pin
Nelek5-Nov-07 23:28
protectorNelek5-Nov-07 23:28 
GeneralRe: how to initialize a form? Pin
panthal5-Nov-07 23:36
panthal5-Nov-07 23:36 
QuestionError in calling a function that gets an array of pointers to base class [modified] Pin
mrobeda5-Nov-07 22:52
mrobeda5-Nov-07 22:52 
Hi,
I need to use a function that uses an array of pointers to a base class, and inside the function handles the pointer according to it's real type (Tha actual type is a derived class).
But i get an error when i call the function :

"Object0124.cpp(1905) : error C2664: 'InsertOutputData' : cannot convert parameter 1 from 'class Array<class Object0124::CDerived *,class Object0124::CDerived *> *' to 'class Array<class Object0124::CBase *,class Object0124::CBase *> &'
A reference that is not to 'const' cannot be bound to a non-lvalue"

I hope that it's clear:
h. file
----------
class CBase
{
int x;
CBase(){x=0;}
};

class CDrived :public base
{
int y;
CString z;
CDrived(){y = 0;z = _T("");}

};
typedef Array<CBase*,CBase *> m_CBaseArray;
typedef Array<CDerived*,CDerived *> m_CderivedArray;
void InsertOutputData(CBaseArray &arrInput,int Mode);

cpp file
---------
void Func()
{
CderivedArray arr;
CDrived var;
var.x = 10;
var.y = 16.533;
var.z = "value"
arr.Add(var)
InsertOutputData(&arr);//or InsertOutputData(arr);//error C2664
}
void InsertOutputData(CBaseArray & arrInput,int mode)
{
for(i = 0;j = 1; j < arrInput.GetSize(),!; j++)
{
if((arrInput.GetAt(i)->x != arrInput.GetAt(j)->x))
{
if(arrInput.GetAt(i)->y == arrInput.GetAt(j)->y)
{
//do something
}
}
}
}


Can anyone tell me what am i doing wrong???






-- modified at 5:22 Tuesday 6th November, 2007
AnswerRe: Error in calling a function that gets an array of pointers to base class Pin
Cedric Moonen5-Nov-07 22:59
Cedric Moonen5-Nov-07 22:59 
AnswerRe: Error in calling a function that gets an array of pointers to base class Pin
jhwurmbach5-Nov-07 23:50
jhwurmbach5-Nov-07 23:50 
GeneralRe: Error in calling a function that gets an array of pointers to base class Pin
mrobeda5-Nov-07 23:58
mrobeda5-Nov-07 23:58 
GeneralRe: Error in calling a function that gets an array of pointers to base class Pin
Cedric Moonen6-Nov-07 0:12
Cedric Moonen6-Nov-07 0:12 
GeneralRe: Error in calling a function that gets an array of pointers to base class Pin
jhwurmbach6-Nov-07 0:33
jhwurmbach6-Nov-07 0:33 
GeneralRe: Error in calling a function that gets an array of pointers to base class Pin
mrobeda6-Nov-07 2:34
mrobeda6-Nov-07 2:34 
QuestionBrowse the file and read it. Pin
CodingLover5-Nov-07 22:44
CodingLover5-Nov-07 22:44 
AnswerRe: Browse the file and read it. Pin
Cedric Moonen5-Nov-07 22:55
Cedric Moonen5-Nov-07 22:55 
GeneralRe: Browse the file and read it. Pin
CodingLover5-Nov-07 23:05
CodingLover5-Nov-07 23:05 
GeneralRe: Browse the file and read it. Pin
Cedric Moonen5-Nov-07 23:12
Cedric Moonen5-Nov-07 23:12 
GeneralRe: Browse the file and read it. Pin
CodingLover5-Nov-07 23:16
CodingLover5-Nov-07 23:16 
AnswerRe: Browse the file and read it. Pin
Jhony george5-Nov-07 23:06
Jhony george5-Nov-07 23:06 
AnswerRe: Browse the file and read it. Pin
Nelek5-Nov-07 23:26
protectorNelek5-Nov-07 23:26 
QuestionRe: Browse the file and read it. Pin
CodingLover5-Nov-07 23:34
CodingLover5-Nov-07 23:34 
AnswerRe: Browse the file and read it. Pin
Hamid_RT5-Nov-07 23:46
Hamid_RT5-Nov-07 23:46 
GeneralRe: Browse the file and read it. Pin
CodingLover6-Nov-07 0:13
CodingLover6-Nov-07 0:13 
GeneralRe: Browse the file and read it. Pin
Hamid_RT6-Nov-07 1:40
Hamid_RT6-Nov-07 1:40 

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.