Click here to Skip to main content
15,917,642 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: can anybody tell me where ....? Pin
led mike21-Dec-06 4:46
led mike21-Dec-06 4:46 
QuestionValue classes and structs Pin
kristmun20-Dec-06 21:47
kristmun20-Dec-06 21:47 
AnswerRe: Value classes and structs Pin
led mike21-Dec-06 4:50
led mike21-Dec-06 4:50 
QuestionConverting a IntPtr to HWND ? Pin
Fritzables20-Dec-06 17:08
Fritzables20-Dec-06 17:08 
AnswerRe: Converting a IntPtr to HWND ? Pin
User 58385220-Dec-06 18:38
User 58385220-Dec-06 18:38 
GeneralRe: Converting a IntPtr to HWND ? Pin
Fritzables21-Dec-06 10:41
Fritzables21-Dec-06 10:41 
QuestionPassing Reference to Thread Delegate Pin
ricecake20-Dec-06 8:54
ricecake20-Dec-06 8:54 
QuestionDispatching based on Names Pin
ComplexLifeForm19-Dec-06 21:33
ComplexLifeForm19-Dec-06 21:33 
Hi All,

I have a design question and I am looking for a best way to implement it.
Say I have a method which returns a string e.g.

string str = MyMethod();

MyMethod returns a string from one of the predefined strings. Based on the return value I need to execute certain sequence of methods. I do not want to implement it using an ugly if-else statements, so what is my best bet to implement it. I am looking for something like auto dispatching based on return values. Also the number of predefined strings can go up in future, so I do not really want to touch the code everytime a new string is added.

I have thought of associative array's based solution. The array will store the string to method mapping and based on the return value the correct method will be invoked. But I am not sure if this is an elegant solution.

Can someone please guide me on how to go about for an elegant solution.

Thanks and Regards.
AnswerRe: Dispatching based on Names Pin
bsaksida19-Dec-06 22:16
bsaksida19-Dec-06 22:16 
GeneralRe: Dispatching based on Names Pin
ComplexLifeForm20-Dec-06 0:15
ComplexLifeForm20-Dec-06 0:15 
AnswerRe: Dispatching based on Names Pin
led mike20-Dec-06 4:46
led mike20-Dec-06 4:46 
QuestionReading & Writing Config Files Pin
mactick19-Dec-06 20:36
mactick19-Dec-06 20:36 
AnswerRe: Reading & Writing Config Files Pin
bsaksida19-Dec-06 22:21
bsaksida19-Dec-06 22:21 
QuestionRe: Reading & Writing Config Files Pin
mactick19-Dec-06 23:22
mactick19-Dec-06 23:22 
AnswerRe: Reading & Writing Config Files Pin
bsaksida19-Dec-06 23:29
bsaksida19-Dec-06 23:29 
QuestionRe: Reading & Writing Config Files Pin
mactick19-Dec-06 23:34
mactick19-Dec-06 23:34 
AnswerRe: Reading & Writing Config Files Pin
bsaksida20-Dec-06 0:24
bsaksida20-Dec-06 0:24 
AnswerRe: Reading & Writing Config Files Pin
led mike20-Dec-06 4:33
led mike20-Dec-06 4:33 
QuestionHi!!! Pin
alijon19-Dec-06 18:39
alijon19-Dec-06 18:39 
AnswerRe: Hi!!! Pin
kristmun19-Dec-06 20:07
kristmun19-Dec-06 20:07 
AnswerRe: Hi!!! Pin
Mark Salsbery20-Dec-06 12:41
Mark Salsbery20-Dec-06 12:41 
QuestionCan a class object in Dialog based application serialized? Pin
Sunil Jampa19-Dec-06 15:54
Sunil Jampa19-Dec-06 15:54 
GeneralRe: Can a class object in Dialog based application serialized? Pin
prasad_som19-Dec-06 20:44
prasad_som19-Dec-06 20:44 
QuestionListView Headrs Pin
bsaksida19-Dec-06 10:23
bsaksida19-Dec-06 10:23 
AnswerRe: ListView Headrs Pin
User 58385219-Dec-06 12:04
User 58385219-Dec-06 12:04 

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.