Click here to Skip to main content
16,012,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is it possible ? Pin
CPallini11-Jun-08 2:58
mveCPallini11-Jun-08 2:58 
GeneralRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 5:34
Ahmed Charfeddine11-Jun-08 5:34 
GeneralRe: Is it possible ? Pin
CPallini11-Jun-08 9:30
mveCPallini11-Jun-08 9:30 
GeneralRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 23:44
Ahmed Charfeddine11-Jun-08 23:44 
AnswerRe: Is it possible ? Pin
KarstenK11-Jun-08 4:01
mveKarstenK11-Jun-08 4:01 
GeneralRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 5:36
Ahmed Charfeddine11-Jun-08 5:36 
GeneralRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 5:37
Ahmed Charfeddine11-Jun-08 5:37 
AnswerRe: Is it possible ? Pin
jhwurmbach11-Jun-08 4:13
jhwurmbach11-Jun-08 4:13 
hINTModuleState wrote:
Now what I need to do is to be able to "grab the name of" the passed parameter variable, and use it to customize the behaviour of the function Function1.


That is bad design. Take one mental step back and think what you want to *Do*.
You need to transport information about a WHAT (your variable value) and a HOW into your function. You can either introduce another parameter (as already posted).
Alternatively, and more "The C++ way" would be to use different parameter types and overloading.
class Strategy
{
  public:
  Strategy( int Value} 
  : m_value( Value)
  {}
  int GetValue(){ return value;}
  private:
  int m_value; 
}
class StrategyA : public Strategy
{
  StrategyA( int Value) : Strategy( Value)
  {}
}
class StrategyB : public Strategy
{
  StrategyB( int Value) : Strategy( Value)
  {}
}class StrategyC : public Strategy
{
  StrategyC( int Value) : Strategy( Value)
  {}
}void Function1(StrategyA iArgument)
{
//Code Block CB1
}

void Function1(StrategyB iArgument)
{
//Code Block CB2
}

void Function1(StrategyC iArgument)
{
//Code Block CB3
}


Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency"

GeneralRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 5:44
Ahmed Charfeddine11-Jun-08 5:44 
AnswerRe: Is it possible ? Pin
Ahmed Charfeddine11-Jun-08 5:52
Ahmed Charfeddine11-Jun-08 5:52 
QuestionHow to change icon appearing in taskbar in "grouped state" ? Pin
cagespear11-Jun-08 2:44
cagespear11-Jun-08 2:44 
QuestionRe: How to change icon appearing in taskbar in "grouped state" ? Pin
David Crow11-Jun-08 3:26
David Crow11-Jun-08 3:26 
AnswerRe: How to change icon appearing in taskbar in "grouped state" ? Pin
cagespear11-Jun-08 5:59
cagespear11-Jun-08 5:59 
GeneralRe: How to change icon appearing in taskbar in "grouped state" ? Pin
David Crow11-Jun-08 6:07
David Crow11-Jun-08 6:07 
GeneralRe: How to change icon appearing in taskbar in "grouped state" ? Pin
cagespear11-Jun-08 19:46
cagespear11-Jun-08 19:46 
AnswerRe: How to change icon appearing in taskbar in "grouped state" ? Pin
KarstenK11-Jun-08 3:51
mveKarstenK11-Jun-08 3:51 
GeneralRe: How to change icon appearing in taskbar in "grouped state" ? Pin
Graham Shanks11-Jun-08 23:34
Graham Shanks11-Jun-08 23:34 
QuestionCString to float conversion or Vice-Versa. Pin
Le@rner11-Jun-08 2:36
Le@rner11-Jun-08 2:36 
AnswerRe: CString to float conversion or Vice-Versa. Pin
toxcct11-Jun-08 2:42
toxcct11-Jun-08 2:42 
GeneralRe: CString to float conversion or Vice-Versa. Pin
Le@rner11-Jun-08 2:45
Le@rner11-Jun-08 2:45 
AnswerRe: CString to float conversion or Vice-Versa. Pin
Graham Shanks11-Jun-08 2:44
Graham Shanks11-Jun-08 2:44 
GeneralRe: CString to float conversion or Vice-Versa. Pin
Le@rner11-Jun-08 2:49
Le@rner11-Jun-08 2:49 
GeneralRe: CString to float conversion or Vice-Versa. Pin
Graham Shanks11-Jun-08 3:02
Graham Shanks11-Jun-08 3:02 
AnswerRe: CString to float conversion or Vice-Versa. Pin
Jijo.Raj11-Jun-08 3:02
Jijo.Raj11-Jun-08 3:02 
AnswerRe: CString to float conversion or Vice-Versa. Pin
KarstenK11-Jun-08 3:55
mveKarstenK11-Jun-08 3:55 

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.