|
Sauro Viti wrote: Can you post a code snippet of your declaration?
const struct CameraType
{
core::vector3df FRONTCAM;
core::vector3df BEHINDCAM;
core::vector3df TOPCAM;
};
|
|
|
|
|
A misunderstanding: I meant the line of code on the .cpp file that gave you the error
|
|
|
|
|
declaring as const should not generate the compilation error you had.
Watched code never compiles.
|
|
|
|
|
|
Please check all the spellings you have defined and used once ... This works some times for me.
|
|
|
|
|
Hi all,
i have no idea about thread pool or multi threading,i need to implement in my application.
please help me for this.
provide me info or any example to implement it.
thanks in advance.
|
|
|
|
|
What exactly are you trying to do?
Threads are created in Windows using the CreateThread[^] API.
|
|
|
|
|
Hi ,
i have an list control and there is so much items.
list control have list of site links here i want to chk status of all links.
but all links have diffrent interval time to chk the link status so thats why not able to chk with single thread or function.
please tell me how can i do this for each and every link individually.
each link checked after given interval and return status after checking.
thanks in advance.
|
|
|
|
|
For starters, I would recommend creating one thread each for every list control item.
The link could be passed as a parameter to the thread.
Later I would recommend creating a set of threads and engaging only those threads.
|
|
|
|
|
is working even if the number of items in list is too large ?
its safe to use it.
|
|
|
|
|
It will work for large number of items, but it will not be a good design and will have performance problems.
But since you're a beginner in multi-threading, I would recommend you do this first and then optimize it.
|
|
|
|
|
ok i'll try this but if its not good for performance,so please tell me the any other optimize and efficient menthod,i also try and start with right way and option.
|
|
|
|
|
You could start by looking at the CreateThreadpool API which is available from Vista onwards.
|
|
|
|
|
can u please provide me any example or sample application for this.
|
|
|
|
|
|
I am writing some software that has a third party dialog box(dragon naturally speaking software) that pops up, is smaller than my welcome screen, and gets pushed behind my welcome screen when someone clicks away from the third party dialog box.
Basically I want to treat it like a parent/child situation where you cannot click away from the form unless the cancel/ok button is pressed.
I don't have much control over the dialog box, other than sending it Window's messages.
I can get the handle to the box too, but I'm just not sure how I stop people from clicking away from the window(which can start other threads and can crash the software).
Any ideas?
|
|
|
|
|
You can disable the window from which the Dragon window is invoked.
Use EnableWindow for this.
|
|
|
|
|
I'm not sure if this will solve your problem, but you could check and ensure that you open the dialog with DoModal().
|
|
|
|
|
Why is more apropriate to write
if(true == a)
instead of
if(a == true)
and why the
if(a)
is avoidable. I mean not avoidable, but the first two are preferable.
|
|
|
|
|
TCPMem wrote: if(true == a)
because if you type "=" instead of "==" the compiler will report an error.
M.
Watched code never compiles.
|
|
|
|
|
They are all largely a matter of style, although option 1 tends not to be used in C++ as most modern compilers tend to query expressions of the form:
if (a = true)
on the basis that it is probably a typo. The last form is quite acceptable although once again things have moved on with C++ and a might not be a bool type.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
TCPMem wrote: Why is more apropriate to write
if(true == a)
Because the compiler will catch the error if you mistakingly use an assignment operator.
TCPMem wrote: if(a)
is avoidable. I mean not avoidable...
This is simply checking if a has a non-zero value (regardless of what type it is).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
i personally dislike
if (a) because it isn't obvious at the very first look what exactly 'a' is, it could be a bool, an int, a pointer, an instance of a class with a bool operator, and it can be confusing if you are e.g. reading someone else's code and do not have an in-depth knowledge of what is what and why.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Actually if you use this form strictly to check if a is true instead of for example checking if the integer value is 0 this form is very clear.
|
|
|
|
|
As Richard said, it is a matter of style really. That form can also be very easily readable with well named variables, e.g:
if (noMoreItemsLeft) EndOfItems(); looks quite obvious when you read through the code, but
if (!ptrToNextItem) EndOfItems(); you have to 'analyze' this, if not ptrToNextItem, this means, if ptrToNextItem is zero, then...
I also don't like situations like this:
class AClass
{
public:
int Integer;
bool Bool;
AClass(int i, bool b):Integer(i),Bool(b) {}
operator bool() const { return Bool; }
AClass &operator =(int i) { Integer = i; return *this; }
};
...
AClass A(0, true);
if (A) A = 3;
...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|