|
The MS C++ compiler doesn't generate C code, it directly compiles the C++ source that you give it. You'd need to find a compiler that goes through the intermediate step of changing C++ into C à la cfront.
|
|
|
|
|
How do I set the hiword of a tchar array with the a particular length
|
|
|
|
|
Didn't you read my answer for your previous question?
|
|
|
|
|
HI all.
I have problem:
I write class to hanedle 'DBF' file.
But wen I try to use my class in some program that I write in C++ 6.0 I get some problem.
I write this class in C++.NET and defaulte wos "Use Unicode Character Set"
In my project on C++ 6.0 defaulte is not unicode char set, Sow can you help me how to convert my project char set.
|
|
|
|
|
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?
|
|
|
|