|
I have slve this problem.
thanks anyway.
|
|
|
|
|
david bagaturia wrote: In my project on C++ 6.0 defaulte is not unicode char set
But indeed, you can choose to make a UNICODE build.
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.
|
|
|
|
|
Hi,
I was wondering if is that possible to apply a custom skin for a number of different buttons (and not the same skin for all buttons) like a media player with play, pause, stop etc using DirectSkin OCX?
Any samples ?
Regards,
sdancer75
|
|
|
|
|
Hi
I´m having some problem with my app.
In my computer it works fine, but when I use it in other computers or my mates try to use it on their notebook (a portable computer is called like that, isn't it?) sometimes some controls dissapear... For example a Static text, a button... It´s random. It dowsan't happen regularly... Why could it be?
Thanks
Time to come clean...
Vive y deja vivir / Live and let live
Javier
|
|
|
|
|
did you give release build?
|
|
|
|
|
Yes, I´m using release build.
Anyway, we are using the exe, the definitive app with its setup and all the files.
What makes me sick is that it doesnt happen in my computer and my mate working on another city can find it really easyly. Could it be some hardware differences?
Time to come clean...
Vive y deja vivir / Live and let live
Javier
|
|
|
|
|
garfield185 wrote: Could it be some hardware differences?
I give only 1% chance for that. May be some enviroment problem.
|
|
|
|
|
Try scaling the problem down to just a simple dialog box with a handful of controls.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Update the video driver. I remember seeing tree controls start drawing funky (like only half of the [+] button showing up), and it was fixed in newer drivers.
|
|
|
|
|
Hi to all!
i would like some help in using stl.
how can i use it to store pointers.
typedef std::set<cdata*> DataCol declaration does not seem to work.
hope someone can provide me with a sample program.
thanks for the help!
newbie
|
|
|
|
|
There are many container classes in the STL library each able to store pointers. You have to choose the one that better fits your needs, for instance, if you need a dynamic array, then use the vector class. On the other hand, if you prefer to access elements by a key, then use a map , and so on.
Please read the MSDN STL documentation: there are specific samples.
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.
|
|
|
|
|
Hi! thanks for the reply.
i have been browsing thru msdn unfortunately i cannot find any sample regarding storing pointers using stl set.
i have written some code... i have a class which have a friend operator< function and the stl::set i have contains pointers to this class... when i run the code the items in the set are not sorted.. it seems like it does not pass the operator< that i have written...
thanks again. hope to someone can help me out. thanks!
newbie
|
|
|
|
|
Show us how you wrote your friend operator<
--
=====
Arman
|
|
|
|
|
Hi Arman
im not also sure if what i did was correct...
i am working around the code that was also given as an answer to my previous post... the original declaration of the set was
typedef std::set < CData > DataCollecton_t;
and i changed it to
typedef std::set < CData* > DataCollecton_t;
the friend function is
friend bool operator<(const CData &l, const CData &r)
{
if (l.priority_<r.priority_)
{
="" return="" true;
="" }
="" else
="" l.priority_="=r.priority_" &&="" l.group_<r.group_;
="" }
the="" sample="" was="" working="" before="" i="" changed="" the="" set="" declaration="" to=""
typedef="" std::set="" <="" cdata*=""> DataCollecton_t;
thanks!
newbie
|
|
|
|
|
friend bool operator<(const CData &l, const CData &r)
This is wrong. Now you have no CData objects inside the set but pointers, or more precise - integer values [addresses]. So the usual address [integer] comparision takes place.
You can pass a comparator to the set ctor. A comparator is an object that acts as a function;
struct cmp
{
bool operator () (const CData *p, const CData *q)
{
if (p->priority_) return true;
return p->priority_ == q.priority_ && p->group_;
}
};
typedef std::set < CData*, cmp > DataCollecton_t;
--
=====
Arman
|
|
|
|
|
Thanks for all the replies Arman!
i will try it out.
thanks again!
newbie
|
|
|
|
|
If you store pointers in a set, the set is ordered by the pointer values (the addresses) and not by the values of your objects. You can either provide a customized comparer function object as the second template parameter or use the boost::ptr_set.
Regards,
Tim
|
|
|
|
|
You have to pass your own comparer function object , otherwise the set will use the standard pointer comparison one (based on their addresses). I made a little test. Code is not elegant but it shows the point
class Atest
{
friend struct comp;
public:
Atest(int i, char c)
{
_i = i;
_c = c;
}
bool comp( Atest * pb)
{
return ( _c < pb->_c) ? true : false;
}
void dump(FILE * fp)
{
fprintf(fp, "{%d,%c}\n", _i, _c);
}
private:
int _i;
char _c;
};
struct comp : public binary_function<Atest *, Atest *, bool>
{
bool operator()(const Atest * pa, const Atest * pb) const
{
return (pa->_c < pb->_c) ? true: false;
}
};
int main(int argc, char* argv[])
{
Atest at1(5,'v'), at2(6,'a');
std::set< Atest *, comp> s;
s.insert(&at1);
s.insert(&at2);
std::set< Atest *, comp>::iterator it;
for (it = s.begin(); it != s.end(); it++)
{
(*it)->dump(stdout);
}
return 0;
}
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.
|
|
|
|
|
Thanks Pallini and Tim!
i will try to write some code using what u have posted.
thanks!
newbie
|
|
|
|
|
Hi
in vc++, In my application i am showing my data in list control box from data bases , now my requirment is that when i double click on an individual
data in list box an specific event is fired.
i am using LBN_DBLCLK but its not work properly. can any one told me
how we can do this
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: i am using LBN_DBLCLK but its not work
Why it didnt work can you explain more?
|
|
|
|
|
Guruji
In this case suppose 10 item come from database suppose its iD
10
11
12
13
20
Now my requirment is that when i bouble click 10 a specific action perform and when double click 11 action perform for id 11 but
in my case its fail
so can u told me in detail
Regard's
Kaushik
|
|
|
|
|
Do you need to this code?
void CDialogDlg::OnLbnDblclkList1()
{
switch(m_List.GetCurSel())
{
case 0:
MessageBox("A");
break;
case 1:
MessageBox("B");
break;
case 2:
MessageBox("C");
break;
}
}
if its not your answer can your more explain,please
|
|
|
|
|
Hi
MSDN says
This message is sent only by a list box that has the LBS_NOTIFY style.
|
|
|
|
|
Y_Kaushik wrote: i am using LBN_DBLCLK but its not work properly.
Why not? Remember, the quality of answer you receive is directly proportional to the amount of relevant information that you provide.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|