Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalpointer to function from its name Pin
fickdb10-Nov-04 18:16
fickdb10-Nov-04 18:16 
Generaltake alook Pin
Anonymous10-Nov-04 19:47
Anonymous10-Nov-04 19:47 
GeneralRe: take alook Pin
fickdb11-Nov-04 4:42
fickdb11-Nov-04 4:42 
GeneralRe: pointer to function from its name Pin
jan larsen10-Nov-04 23:47
jan larsen10-Nov-04 23:47 
GeneralRe: pointer to function from its name Pin
fickdb11-Nov-04 4:46
fickdb11-Nov-04 4:46 
GeneralRe: Templates? Pin
Budric B.11-Nov-04 5:45
Budric B.11-Nov-04 5:45 
GeneralRe: Templates? Pin
fickdb11-Nov-04 6:59
fickdb11-Nov-04 6:59 
GeneralRe: pointer to function from its name Pin
jan larsen12-Nov-04 0:21
jan larsen12-Nov-04 0:21 
fickdb wrote:
I think its ok for pure c functions, but my prob is that i need to make a new object only knowing his name (or his constructor name). same problem as above except that foo and bar are classes...

The word you're looking for, I suppose, is Reflection. This is not possible in C++ for the same reasons as I mentioned before.
But you can of course work around the limitations, to do so requires a solid knowledge of the language and tools.
If you know, and understand, COM, you will realize that the interface IDispatch is invented for just that reason. Again, if you really need the feature, you could either use COM and IDispatch, or you could copy the technique.
What it all comes down to though, is that you're probably better of using C# for your project.

"After all it's just text at the end of the day. - Colin Davies

"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
GeneralSolution ? Seems to work ;) Pin
fickdb12-Nov-04 0:49
fickdb12-Nov-04 0:49 
GeneralRe: Solution ? Seems to work ;) Pin
Anonymous12-Nov-04 10:22
Anonymous12-Nov-04 10:22 
GeneralCreating Dialog Based Application which takes Paramters as input. Pin
Anonymous10-Nov-04 17:52
Anonymous10-Nov-04 17:52 
GeneralRe: Creating Dialog Based Application which takes Paramters as input. Pin
Kapoor Vikrant11-Nov-04 0:39
Kapoor Vikrant11-Nov-04 0:39 
QuestionHow to do Insert ,delete actions in SQL Database using C++? Pin
pubududilena10-Nov-04 17:18
pubududilena10-Nov-04 17:18 
AnswerRe: How to do Insert ,delete actions in SQL Database using C++? Pin
Steve S11-Nov-04 0:44
Steve S11-Nov-04 0:44 
QuestionCan I export BC++4.5 project to VC++? Pin
alexdai10-Nov-04 16:03
alexdai10-Nov-04 16:03 
Generalactivex Pin
hou_12610-Nov-04 13:54
hou_12610-Nov-04 13:54 
GeneralRe: activex Pin
bryce10-Nov-04 14:59
bryce10-Nov-04 14:59 
GeneralRe: activex Pin
hou_12610-Nov-04 15:09
hou_12610-Nov-04 15:09 
GeneralVisual C++ test Pin
act_x10-Nov-04 12:57
act_x10-Nov-04 12:57 
GeneralRe: Visual C++ test Pin
Christian Graus10-Nov-04 13:17
protectorChristian Graus10-Nov-04 13:17 
GeneralRe: Visual C++ test Pin
Anonymous10-Nov-04 13:23
Anonymous10-Nov-04 13:23 
GeneralRe: Visual C++ test Pin
Christian Graus10-Nov-04 13:25
protectorChristian Graus10-Nov-04 13:25 
GeneralRe: Visual C++ test Pin
Anonymous10-Nov-04 13:27
Anonymous10-Nov-04 13:27 
GeneralRe: Visual C++ test Pin
Christian Graus10-Nov-04 13:36
protectorChristian Graus10-Nov-04 13:36 
GeneralRe: Visual C++ test Pin
Anonymous10-Nov-04 15:01
Anonymous10-Nov-04 15:01 

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.