gafferuk wrote:
>
>
>
> gafferuk wrote:
>>
>> Im trying to create my own scripting engine/language.
>>
>> Is it possible to call a c++ class method by string name and also pass in
>> the parameters?
>>
>> for example I have a class called MyClass with a method called callme:
>>
>> bool MyClass::callme(string name)
>> {
>> cout << "Hello " << name.c_str() << "\n";
>>
>> return true;
>> }
>>
>> Normally would call it by using:
>>
>> bool res = myClass->callMe("Harry");
>>
>> what I want is a command like:
>>
>> bool res = callAMethod("MyClass", "callme", "Harry");
>>
>> any ideas to get something like that?
>>
>>
>>
>
> found what i need:
>
> http://stackoverflow.com/questions/801070/dynamically-invoking-any-function-by-passing-function-name-as-string
>
thats not what i need, that for c# not c++.
can anyone help with my original question?
--
View this message in context:
http://old.nabble.com/call-c%2B%2B-method-by-string-name-%2B-passing-parameters-tp27196409p27196913.html
Sent from the Gnu - Common C++ mailing list archive at Nabble.com.
_______________________________________________
Bug-commoncpp mailing list
Bug-commoncpp@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-commoncpp