|
It sounds like you need a separate thread to do the work so that the main thread can respond to the UI messages. Without more details, however, I can't say for sure.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Problem is resolved using:
Invalidate();
UpdateWindow();
thanks to MSalsbery and the rest whom replied
thanks all!
/Johannes
|
|
|
|
|
I just installed VC8 and am in the process of integrating my projects. There are many errors I have never seen before, also the layout of VC8 is somewhat confusing.
Two errors are my main concern right now:
1. error C2058: constant expression is not integral
Comes from an enum declared within a class
enum Keys
{
classesRoot = HKEY_CLASSES_ROOT,
};
and:
2. cannot convert parameter 1 from '_single_tile *' to 'std::_Vector_iterator<_Ty,_Alloc>'
tiles.erase(&tiles[p2]);
where tiles is a vector of structs. This works well in VC6, I can't understand why VC8 throws an error.
|
|
|
|
|
With the first one, locate the definition of HKEY_CLASSES_ROOT. As the error message indicates, it must be integral, so wherever you have it defined, it is likely not integral. As to your second one, I'm guessing that the changes implemented to the STL that ships with VC8 are considerable when comparing it to the STL that shipped with VC6. There is likely a standards conformance reason for some change that is causing your code to now produce that error. Someone with more STL knowledge might provide better insight though.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
I don't mean to sound stupid, but what does integral mean?
|
|
|
|
|
Integral means that the type must be int or at the least convertable to int.
Chris Meech
I am Canadian. [heard in a local bar]
Nobody likes jerks. [espeir]
The zen of the soapbox is hard to attain...[Jörgen Sigvardsson]
I wish I could remember what it was like to only have a short term memory.[David Kentley]
|
|
|
|
|
Well this fixed the first error, though I am still unsure what the error means.
enum Keys
{
classesRoot = 0x80000000,
currentUser ,
localMachine ,
users ,
performanceData ,
currentConfig ,
dynData
};
As for the second error, I still don't know how to fix. I could typecast it (bad programming) but I would prefer to fix it the correct way.
|
|
|
|
|
(2) That should never have compiled anyway. The standard way to use erase is to pass an iterator (vector.begin() + index).
|
|
|
|
|
And for (1), use the following to get rid of the error :-
enum Keys
{
classesRoot = (LONG)(ULONG_PTR)HKEY_CLASSES_ROOT
};
|
|
|
|
|
Nish, I want to give you a big wet kiss )
Now to get rid of those 'deprecated' warnings.
|
|
|
|
|
waldermort wrote: There are many errors I have never seen before...
Because VC++ is now more compliant.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
VC6 let you treat an iterator as a pointer. That's what you're trying to do here, in reverse, grab a pointer and pass it through as if it were an iterator. The change is to make it more standards conformant, and it happened in VC2002.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Guess you learn something new every day. I always thought an iterator was a pointer, except for the fact that when increasing it it instead increases by the size of what it's pointing at.
As for this VS8, it's already making my eyes ache
|
|
|
|
|
A pointer has behaviour that makes it a valid random access iterator, they basically behave the same.
Yeah, it was a big change ( and a change to being more VB like IMO ). The absence of the class wizard is a pain, the new system doesn't work as well IMO, I tend to hand wire events ( but then, I always did ). But, once you're used to it, it is a lot better, although VC2005 C++ support in things like intellisense is not so great.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
My first impression was not all that great. I have had to find and change so many setting/options/toolbars.. just to have an environment similar to what I am used to.
I have never used the class wizard so I'm not missing anything there. I do like the extra memory validation that goes on the background though. It found a few stack corruptions that I would have otherwise missed (partly due to converting to the 'safe' CRT).
I'm not sure if it's my configuration or just the IDE, but the compile times have almost doubled. It can be a pain when trying to debug. Also, I have not figured out yet how to position the watch window. It's currently tabbed, I want to be able to see the watch and the local/auto variables at the same time.
Gonna take some time to get used used to.
|
|
|
|
|
waldermort wrote: enum Keys
{
classesRoot = HKEY_CLASSES_ROOT,
};
If you don't really need an enum type, it might be better to turn those into static const members, which you can init in the header file:
class CFoo
{
public:
static const HKEY classesRoot = HKEY_CLASSES_ROOT;
}; That also has the advantage of preserving the type-safety of classesRoot .
|
|
|
|
|
RE: Problem #2.
Your old code worked because previous versions of the stl implemented iterators as C++ pointers.
In the latest implementation you can no longer assume that iterators and pointers are equivalent.
tiles.erase( ( tiles.begin() + p2 ) ) shoule work fine assuming that p2 is the index of the element you want to remove.
|
|
|
|
|
I wish to display a help file (*.chm) in a VC++ 6.0 MFC Application .
I've created the CHM file using a software and I just want to display the chm file when the Help button is clicked.
It's better if u can give a sample code.
Your help is highly appreciated.
Thanks in Advance
TDK
ENTC
UoM
|
|
|
|
|
|
Dhananjayak02 wrote: ve created the CHM file using a software and I just want to display the chm file when the Help button is clicked.
associate the help chm with the help id!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
When a release build dies with "the instruction at location xyz..." how do I find out the where in the source that was? If I choose to see the stack dump, can that tell me (assuming no stack corruption) what my calling path is?
I assume you need some kind of separate debug info file (with address to function lookups or something) generated at build time.. but I'm not sure what debug info I need to generate, and then how I would tie up the stack and instrucion addresses to functions?
Thnx in advance.
|
|
|
|
|
you need a "Map" file. it'll give you the addresses of all the funcitons in your EXE.
there's a checkbox, somewhere in the linker options, to turn this on.
|
|
|
|
|
|
See if this article helps.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for the help guys. Much appreciated!
|
|
|
|