|
Getting your wishes in early, eh? Don't think I'm letting you off from clubbing together to but me a birthday present in april...
Iain.
|
|
|
|
|
Merry Christmas!!! and Happy New Year Iain..
Regards,
Sandip.
|
|
|
|
|
Merry Christmas sir. I'm a little late though (was still on vacation).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I have four or five kinds of objects, all derived from an indexedObject. indexedObject's have an integer id which can be set and they can be compared with <, >, etc to facilitate sorting, pretty simple class.
I would like to create one class that wraps a list and adds some other functionality and can hold all these kinds of objects. Problem is if I use a std::list<indexedObject> to hold the objects, I lose access to the functions not in indexedObject.
I would store pointers but then sorting and looking up the objects would require lots of extra code.
Is there a way to use the std::list<indexedObject> list to store the objects and cast them back to their derived type as appropriate? I can't use the assignment operator, I get an error.
I thought about all kinds of things like memcpy or something but it seems as if I resort to that I am getting pretty far off the reservation.
Any suggestions?
|
|
|
|
|
Is RTTI [^] what are you looking for?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If i understood you right, what you are doing is a bit dangerous... however, if you are sure about what you are doing, you could try simply get the address of the certain item and convert it to a pointer of the right class and access it thorough that pointer, so what i mean is something like this:
((CIndexedObjectDerivant *)(&list_of_CIndexedObjects[12]))->MyRequiredMethod();
Good luck and marry xmass!
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
FWIW, I was able to do the following -
std::list<iObj> _listA;
std::list<iObj>::iterator _iA;
std::list<dObj<int>> _listB;
std::list<dObj<int>>::iterator _iB;
dObj<int> * p;
int i;
dObj<int> o;
for (i = 5; i > 0; --i)
{
o.setID(i); // method in base class (iObj)
o.setValue(i); // method in derived class (dObj)
_listA.push_back(o);
_listB.push_back(o);
}
_listA.sort();
_listB.sort();
_iA = _listA.begin();
_iB = _listB.begin();
i = (*_iB).getValue(); // works
i = _iB->getValue(); // works although it's not necessarily defined?
p = static_cast<dObj<int> *>(&(*_iA));
i = p->getValue(); // works
_iA++;
p = static_cast<dObj<int> *>(&(*_iA));
i = p->getValue(); // WRONG answer. The id associated with iObj was correct (2) but the
//member variables associated with the derived object have vanished.
return 0;
Guess I will just go with sub classing several different kinds of lists.
|
|
|
|
|
I am getting an error of " stdprn not defined " when I use the folowing code in Code Blocks. I am using Windows Xp.
#include <stdio.h>
main()
{
FILE *stream;
stream = fopen("PRN", "w");
fprintf(stream, "a line of text\n");
}
What should I do?
|
|
|
|
|
|
Uhm...Looks like a deja vu...[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I need the capablitiy to right click on dialog button and display a CMenu object that will have list of options that can be performed. As of right now, I am unable to capture a right mouse click over a dialog button. I am using the ON_WM_RBUTTONDOWN(). The message captures the right mouse clicks over the empty dialog space but no use for me. .
Anyone can recommend, a way to capture right mouse clicks over dialog buttons. I do need to know which button i am over.
Scott Dolan
Jernie Corporation
Engineering & Manufacturing
Software, Hardware, & Enclosures
|
|
|
|
|
Subclass CButton (for the buttons on your dialog) to detect the right button clicks and send some form of notification (a Windows message of some sort) to the dialog?
That's pretty much what I'd do in WTL, although as WTL has the concept of forwarding messages from sub-classed controls to their containers, it'd be a bit simpler.
|
|
|
|
|
Check out this article[^]. It does exactly what you needs - a context menu when you right click on a button!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
i want to creat an bitmap by the mean of CreatBitMap(), but if the DIB data are over 20M, it failed, if the DIB data is 5M,it succeed. is there data length limit?
how can i creat an bit bitmap with the DIB data?
thanks.
|
|
|
|
|
Here[^] it says:
Windows 95/98/Me: The created bitmap cannot exceed 16MB in size.
Could it be that you are using Windows 95/98/Me?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
|
Hope for quick action........
|
|
|
|
|
class ZoomableObject
{
public:
void zoom(double dZoomFactor);
};
void ZoomableObject::zoom(double dZoomFactor);
{
}
just fill the ellipses.
That is: pointless question => pointless answer.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
One of the trick is to use SetViewPortExt()[^] to archive zooming effect. Checkout this article[^]. You can use StretchBlt()[^] as well.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Tuesday, December 23, 2008 9:22 AM
|
|
|
|
|
Here's an old post[^] on that topic
(You need to navigate to my post just below where this takes you for a sample)
|
|
|
|
|
Hello,
I'm new to the forum and the site and I must say that I will mostly enjoy the community My english isn't very well, but I'll try my best in discusions and problem description!
Now the problem:
I'm trying to make a QRS detector GUI. What's it about: I'm using the Pan-Tompkins-based QRS detector in analysing ECG signals. My input is the MIT/BIH arrhythmia database (from 100 to 108) and after it passes through the QRS detection, I have to show that output signal graphicaly in real-time. Something like Chart-o-matic in www.physionet.org but in real-time.
Now, that output signal is a clean signal (couse it passed through the QRS detector) and I have to mark all the R peaks (the highest peak in QRS area) and connect them all with a sinus-like line (something like cubic-spline connection in MATLAB).
I'm using the open-source Hamilton detector with some modifications (I don't need the clasification part) and I just don't know in what program or I what kind of a way to continue.. The real problem is what programming language to use (I only really know to use pure C).
can anyone help with the start?
Thx!
|
|
|
|
|
Men,
i need so Media streaming experts!
I want your suggestion
Now i started coding the Audio video streaming fir the Audio Video Call for my app.
Starting point; Does any one of you, have Ideas about Video/Audio Streaming through a network (Using CAsyncSockets)
Hope i find some answers when i come tomorrow...
Best Regards for all the Men here!...
|
|
|
|
|
Hey friends,
Lookin for a "contact list control"
the ctrl should have The contact name IM button Video-Call button Options button... (Similar to skype contact list)
well hoping that Some one have or have seen such a ctrl..
--------------------------------------------
Some People Dream Of success While others wake-up and workhard to get it..
|
|
|
|
|
How to set string key in CMap.
|
|
|
|
|
For instance, as follows
CMap <LPCTSTR, LPCTSTR, int, int:> myMap;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|