Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: creating a descendant from TComponent & calling its function by their names


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Ahmed Sayed

Posts: 173
Registered: 8/9/07
creating a descendant from TComponent & calling its function by their names  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2015 2:11 PM
Hello everyone,

I am having a hard time doing this in C++ as it does not support RTTI completely.

What i wanna achieve is create a new instance of a TComponent descendant class by its name like this:

TMyComponent  : public TComponent  
{
public:
void __fastcall DoSomething(UnicodeString Param1, int Param2);
};


Now i wanna do is something like this:
void ExecuteClassFunc(UnicodeString ClassName, UnicodeString MethodName, /*Whatever the type here is*/ Params);
 
//Calling it.
 
ExecuteClassFunc("TMyComponent","DoSomething",{"some text", 10});


I wanna achieve this using Delphi RTTI, STL, boost::function, std::bind, pointer to functions or whatever means necessary.

Note: Classes will be created in Dlls and i have to build the apps and dlls without linking with run-time packages.

--
The limits of my language mean the limits of my world
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02