setting properties of objects from a different program

M

Mark

Im just a bit playing with C++ so please no questions on why i am
doing it.

This is what i am creating:
I have an application that can load dll's
Such a dll will then act as a normal program but creating all the
visual stuff is handled by the main program.

example:
-dll starts
-dll wants to display a form so it calls the createform function from
the main applicaiton
-the main appliaction creates the form
-dll wants to display a button so it calls the create button function
-the main application creates a button on the form.

Now comes the part i can't get to work.
I want to use one (or few) function(s) the set all the properties of
any object.

example:
-dll calles functions setproperty with variables indicating that is
wants to set the height to 10
-main applications searches for the wanted object and sets the height
to 10.

locating the object is easy but how can i set that property? i dont
know what kind of object the dll will use until the program is running
 
N

Noah Roberts

Mark said:
Im just a bit playing with C++ so please no questions on why i am
doing it.

This is what i am creating:
I have an application that can load dll's

This group is about C++, not Windows programming. Many here don't know
windows programming. Try a windows newsgroup.
 
M

Mark

Noah Roberts said:
This group is about C++, not Windows programming. Many here don't know
windows programming. Try a windows newsgroup.


yeah well you dont have to know windows programming for this question.
example:
i have 2 classes:
class c1
{
private:
int i1;
};
class c2
{
private:
int i2;
};

and a function
setpropery(classname, variable_name, value)

if i call the function with
setproperty(<instance of c1>, "i1", 10) <-- note the instance is NOT
an pointer
then c1->i1 becomes 10

and if i call it with
setproperty(<instance of c2>, "i2", 20) <-- note the instance is NOT
an pointer
the c2->i2 becomes 20

anyway i dont think it is possible (without checking for each
possibilty seperatly) but if anyone has an idea please post it :)
 
T

Thomas Matthews

Mark said:
yeah well you dont have to know windows programming for this question.
example:
i have 2 classes:
class c1
{
private:
int i1;
};
class c2
{
private:
int i2;
};

and a function
setpropery(classname, variable_name, value)

if i call the function with
setproperty(<instance of c1>, "i1", 10) <-- note the instance is NOT
an pointer
then c1->i1 becomes 10

and if i call it with
setproperty(<instance of c2>, "i2", 20) <-- note the instance is NOT
an pointer
the c2->i2 becomes 20

anyway i dont think it is possible (without checking for each
possibilty seperatly) but if anyone has an idea please post it :)

Since the member variables are private with out any accessor
functions, there is no way for a function external to the
class to set the member variables. I believe this is the
definition of the keyword "private".

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top