Click here to Skip to main content
15,897,187 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: DS_FIXEDSYS in WTL project VS2005 Pin
Jörgen Sigvardsson26-Jun-05 5:59
Jörgen Sigvardsson26-Jun-05 5:59 
GeneralRe: DS_FIXEDSYS in WTL project VS2005 Pin
vassilux@26-Jun-05 9:03
vassilux@26-Jun-05 9:03 
Generalstoring of struct in vector Pin
itkid23-Jun-05 19:55
itkid23-Jun-05 19:55 
GeneralRe: storing of struct in vector Pin
toxcct24-Jun-05 0:35
toxcct24-Jun-05 0:35 
GeneralRe: storing of struct in vector Pin
Nathan Addy26-Jun-05 6:03
Nathan Addy26-Jun-05 6:03 
GeneralGDI+, SetWorldTransform and transformation of objects Pin
flamy23-Jun-05 17:57
flamy23-Jun-05 17:57 
GeneralUsing templates for selecting overloaded functions Pin
ComplexLifeForm23-Jun-05 3:10
ComplexLifeForm23-Jun-05 3:10 
GeneralRe: Using templates for selecting overloaded functions Pin
Joaquín M López Muñoz23-Jun-05 11:37
Joaquín M López Muñoz23-Jun-05 11:37 
You cannot do that: the basic problem is that overload selection takes place at compile time, whereas your iselect value is only known at run time.

So, you need some kind of dynamic dispatch framework to achieve what you're after. The following is a possibility (lacking the terseness of function overloading):
typedef void (* function_t)();
 
void function0(){...}
void function1(){...}
 
function_t function[]={&function0,&function1,...};
 
int main()
{
  int iselect=GetValue();
  function[iselect]();
}
Hope this helps.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralAutomatically scroll a view when using drag and drop Pin
retro_coder22-Jun-05 23:34
retro_coder22-Jun-05 23:34 
GeneralSink Event Problem- Please Help Pin
Raj72321-Jun-05 17:07
Raj72321-Jun-05 17:07 
QuestionA combined Tree View and List View control? Pin
retro_coder20-Jun-05 20:45
retro_coder20-Jun-05 20:45 
AnswerRe: A combined Tree View and List View control? Pin
Jörgen Sigvardsson25-Jun-05 13:50
Jörgen Sigvardsson25-Jun-05 13:50 
QuestionShould COM+ interface be dispatchable ? Pin
duckponf20-Jun-05 14:07
duckponf20-Jun-05 14:07 
AnswerRe: Should COM+ interface be dispatchable ? Pin
Anonymous20-Jun-05 17:11
Anonymous20-Jun-05 17:11 
GeneralWindow Title disappears when changing focus Pin
retro_coder20-Jun-05 1:10
retro_coder20-Jun-05 1:10 
GeneralUsing Context Free Grammers Pin
fordge19-Jun-05 22:09
fordge19-Jun-05 22:09 
GeneralRe: Using Context Free Grammers Pin
Stuart Dootson21-Jun-05 21:49
professionalStuart Dootson21-Jun-05 21:49 
GeneralRe: Using Context Free Grammers Pin
Jörgen Sigvardsson22-Jun-05 8:08
Jörgen Sigvardsson22-Jun-05 8:08 
GeneralUsing WTL in Win32 Pin
daydremer19-Jun-05 17:34
daydremer19-Jun-05 17:34 
GeneralGetting the caret position of a running IE Pin
Member 77730117-Jun-05 5:05
Member 77730117-Jun-05 5:05 
GeneralAccessing HTTPS Webservice using VC++ 7.1 Pin
arun140517-Jun-05 3:33
arun140517-Jun-05 3:33 
GeneralRe: Accessing HTTPS Webservice using VC++ 7.1 Pin
Ed K18-Jun-06 18:01
Ed K18-Jun-06 18:01 
GeneralSingle Application Instance Pin
retro_coder16-Jun-05 18:58
retro_coder16-Jun-05 18:58 
GeneralRe: Single Application Instance Pin
Jack Puppy16-Jun-05 19:08
Jack Puppy16-Jun-05 19:08 
GeneralRe: Single Application Instance Pin
retro_coder16-Jun-05 21:47
retro_coder16-Jun-05 21:47 

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.