Click here to Skip to main content
15,905,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine19-Nov-08 6:25
Ahmed Charfeddine19-Nov-08 6:25 
AnswerRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Roger Stoltz19-Nov-08 6:38
Roger Stoltz19-Nov-08 6:38 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine19-Nov-08 22:22
Ahmed Charfeddine19-Nov-08 22:22 
AnswerRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Roger Stoltz19-Nov-08 22:57
Roger Stoltz19-Nov-08 22:57 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine19-Nov-08 23:24
Ahmed Charfeddine19-Nov-08 23:24 
AnswerRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
sashoalm19-Nov-08 9:05
sashoalm19-Nov-08 9:05 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. [SOLVED] Pin
Ahmed Charfeddine19-Nov-08 21:50
Ahmed Charfeddine19-Nov-08 21:50 
AnswerRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine19-Nov-08 22:14
Ahmed Charfeddine19-Nov-08 22:14 
The callback which accepts a reference is :

void CClassB::OnProcessThisThing(T &t,..other params)
{
}


It is not but an override of a virtual function declared in the base class fromwhich the class
CClassB is deriving :
class CClassA {
protected :
	virtual void OnProcessThisThing(T &t,..other params);//
};


CClassA resides in an external library, an external lcode.(I only got the .h : so I cannot change it).
class CClassB :public CClassA.



CClassB is in my own code which depends on the above thirdparty library.

.


From within CClassB::OnProcessThisThing() I have to deal with an execution case that is triggered
asynchronously. (The external library code, triggers the virtual function in the base class, then
my override method gets focus.).

The reaction code to put in CClassB::OnProcessThisThing is complex.
Adds to that the fact that I have a very other scenario where I would need to execute the same
same reactionn code. Why would I have to make a copy and paste (two separate functions)
if I can merge the two things. Moreover
the two scenarios are coupled : the processing done in reaction to the first scenario
whereby the external code triggers the function, affects the very data and information received by it
when it is triggered internally following the second scenario. Hence merge the two things in a same bloc code
helps me tackle that interaction and easily understand my code.


Now the problem I encountered is how to call that function internally if it has that reference type
parameter.

That is what it was about.
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
CPallini19-Nov-08 23:10
mveCPallini19-Nov-08 23:10 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine19-Nov-08 23:30
Ahmed Charfeddine19-Nov-08 23:30 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. [modified] Pin
CPallini19-Nov-08 23:49
mveCPallini19-Nov-08 23:49 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
Ahmed Charfeddine24-Nov-08 2:21
Ahmed Charfeddine24-Nov-08 2:21 
GeneralRe: Calling a function that accept a refrence to a variable when we don't have a reference to pass.. Pin
CPallini24-Nov-08 2:43
mveCPallini24-Nov-08 2:43 
QuestionButton control Pin
jimjim73319-Nov-08 5:33
jimjim73319-Nov-08 5:33 
AnswerRe: Button control Pin
PJ Arends19-Nov-08 6:12
professionalPJ Arends19-Nov-08 6:12 
AnswerRe: Button control Pin
Nishad S19-Nov-08 17:10
Nishad S19-Nov-08 17:10 
GeneralRe: Button control Pin
jimjim73319-Nov-08 23:45
jimjim73319-Nov-08 23:45 
QuestionVisual C++ 2003 Redistributables [Solved] Pin
bob1697219-Nov-08 5:12
bob1697219-Nov-08 5:12 
AnswerRe: Visual C++ 2003 Redistributables [Solved] Pin
bob1697219-Nov-08 5:29
bob1697219-Nov-08 5:29 
QuestionMFC and Vista General Question Pin
sabdalla8019-Nov-08 4:42
sabdalla8019-Nov-08 4:42 
AnswerRe: MFC and Vista General Question Pin
bob1697219-Nov-08 4:56
bob1697219-Nov-08 4:56 
GeneralRe: MFC and Vista General Question Pin
sabdalla8019-Nov-08 5:32
sabdalla8019-Nov-08 5:32 
GeneralRe: MFC and Vista General Question Pin
bob1697219-Nov-08 6:04
bob1697219-Nov-08 6:04 
GeneralRe: MFC and Vista General Question Pin
bob1697219-Nov-08 7:07
bob1697219-Nov-08 7:07 
GeneralRe: MFC and Vista General Question Pin
bob1697219-Nov-08 7:10
bob1697219-Nov-08 7:10 

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.