|
Cédric,
Thank you for your answer.
But I think it's more difficult.
classA is the base class for all my messages (objects exchange through mailslots).
classB, classC, etc have herited from classA (they are more sophisticated messages).
My function called "Duplicate" function is in reality a function to send a message of classB, C, etc to SEVERAL mailslots (several destination).
So, I want to "give" my sophisticated message reference with its type (which is typeid( xVar)) to my function, wich will do a loop in order to duplicate the given message as necessary as to send it to ALL the mailslots.
It's the destination thread which delete the object after processing.
So, I want to "clone" the object, but the parameter of the function is of type "classA" (which is common to all types), and the type is only known by TYPEID.
Is there a possibility to do that ?
Best regards
|
|
|
|
|
Ok,
Now I have understand the mechanism.
Only a small detail : all the Clone() methods needs to have the same return type. So it's necessary to cast the returned result :
class classB : public classA
{
//...
}
classA* classA::Clone()
{
return new classA(this);
}
classA* classB::Clone()
{
return (classA *) new classB(this);
}
Thank you.
|
|
|
|
|
Hi, sorry for the late answer but I was in holidays.
marcelcerdanjunior wrote: Only a small detail : all the Clone() methods needs to have the same return type. So it's necessary to cast the returned result :
Not necessarily, you can use a 'covariant return type', which means that your classB::Clone method can return a classB* (because classB inherits from classA). Anyway, you never need to cast classB into classA: classB IS already a classA object.
|
|
|
|
|
Dear All,
My project requirement is VC++ application need to create setup package and deployment in VC++ with out using dll file(im having exe file only).
It will be much helpful to me to give some advice on this..
Thank you very much,
Yours,
Anitha
|
|
|
|
|
u looking for NSIS[^] or use Installshield.
Or do you want to create an application installer?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have developed a MFC application.I need to create a setup pack for that application.
Thanks & Regards
Anitha
|
|
|
|
|
then you can use NSIS or installshield. Even with visual studio you can create setup and deployment project
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
We use Inno Setup[^]. It is a very good freeware installer.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi sashoalm,
I red that innosetup document.That installation document given for Visual C++ 6.0.But Im using Visual Studio 2005.Is it possible for Visual Studio 2005.
Thanks & Regards
Anitha
|
|
|
|
|
Yes, it is possible. You just have to create an iss file and specify in it which files are part of the setup.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi sashoalm,
I have created the setup package.But i need to install a driver before the exe file execution. Is it possible?
Thanks & Regards
Anitha
|
|
|
|
|
hi
in my application i have one dll ,and 3 views.
when user clicks on one view --dll function is called(mapped to dll fun)
from that function i nead to send message to other view or same view..how to doit can any one give hint....
|
|
|
|
|
|
thats not correct...un related article u sent..
|
|
|
|
|
Hi all
I need simple time example on dailog.Plz help me
|
|
|
|
|
This link[^]"> will be of little help...
Regards,
Rane
|
|
|
|
|
Thx's for link
I want to use timer for update DoModal() dailog.Can you help me..
void Crtdlg::Ondo()
{
CT dlg;
dlg.DoModal();
}
And i want to update this dailog every 5mins..
Plz help me
|
|
|
|
|
knowvc wrote: Can you help me..
Have you bothered to look at SetTimer() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi all,
I m using Access database,and create a connection thru ODBC.
Its working fine when run application,after sum time its gices an error.
"Too many Client Task
Driver’s SOLSetConnectAttr Failed"
please help me for this.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
How many number of connections have you made?.This limitation could be because of the limitation of the Access Driver. Close some connections and try again..
Regards,
Rane
|
|
|
|
|
Hi
I am writing a program in which a function generates Power of 2 .
I would like to generate say
for eg 2^100
But with int or long int i cant store and process the value.
Any Suggestions on storing and how to calculate the value will be of good help
Thanks
|
|
|
|
|
Use unsigned long long datatype and it can hold values up to 18,446,744,073,709,551,615.
Regards,
Rane
|
|
|
|
|
what if the value exceeds the above specified limit ??
|
|
|
|
|
Then you'll need to treat the numbers as strings instead.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Rane wrote: Use unsigned long long datatype
That only leaves 37 more bits required for the OP to get
an integer representation of 2^100
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|