|
Hi,
I need to build some kind of app which, display a picture and after 10 seconds the next, etc......
To do that, I'll need some kind of timer conrol (like the Timer in .NET), is there something like that in MFC. If there is (I thinks there is), can somebody tell me how to use it?
Thanks
|
|
|
|
|
There is a sleep function that you can use. I just use it as a puase between command, so if i think you want to use it for the same purpose it would be ok. Maybe you can display the first pic, then sleep, then remove the first pic and display the second pic?
Sleep(time)
btw, time is in milliseconds.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
Sleep is a blocking call. No Windows messages can be processed while your thread is blocked. This means that the rest of the user interface will be very unresponsive.
If you don't need the timer to be very accurate, use SetTimer to have Windows send you a message when a timer expires.
|
|
|
|
|
|
CreateWaitableTimer() and SetWaitableTimer() can also be used
"Committee--a group of men who individually can do nothing but as a group decide that nothing can be done." - Fred Allen
|
|
|
|
|
Thanks you everybody; after reading your hints, I finally succeeded in building this part of the app!
;)
|
|
|
|
|
Hi all,
I am having trouble coding this and wanted to know how to check if a user enters a filename to open. Basically I want to check to make sure the file name is not all spaces and that it is not blank. I am not using CFileDialog right now, just have a editbox and a browse button that i got from a CP article.
Does anyone have code out there that does this? Can someone lead me in the right direction?
Thanks for all your help .
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
You can get at the string in the edit box with
CString FileName;
MyEditCOntrol.GetWindowText(&FileName);
You can then perform all of the validation on FileName.
To verify the edit box wasn't blank:
if(!FileName.Getlength())
//handle error here - zero length filename
To verify that no illegal filename characters were entered:
CString InvalidFilenameChars = ""; // put all invalid filename chars in this string
if(FileName.FindOneOf(InvalidFilenameChars) != -1)
//handle error here - filename contains invalid character
There may be a pre-built MFC way of handling all of this.........
|
|
|
|
|
:(hello
I need the source code in c++, for information extraction from html tables , and to generate with those data a XML document.
Please help me
Marco Javier Suarez Baron
|
|
|
|
|
One way is to use the MSHTML control and iterate the HTML Elements. Have a look at the articles here on using the HTML control and on MSDN.
Another option is HTMLTree http://homepage.mac.com/pauljlucas/software/html_tree/[^] however this is GPL, which may be a problem for you.
And finally Google search: HTML parser.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
I am in need of a variable that can hold a type (variable-type ex: int or double) and not a value of the specific type, just the type. Something that works like this:
VARTYPE Type;
Type = int;
switch (Type) {
case short:
break;
case int:
break;
case float:
break;
case double:
break;
} I know I can simply declare a bunch of constant numbers, who each represents a variable type. But that would be very non-optimal if there already exists an easier way. Could I use templates to achieve this or the use of preprocessors/macros? Just to be clear, I am looking for a variable that only contains a type and not a value.
Any help or tips are most appreciated.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
almost:
switch(sizeof(type))
{
case sizeof(short): //need pre-defined
break;
includeh10
|
|
|
|
|
|
|
|
|
|
Ian Darling wrote:
Of course, IIRC, typeid and type_info are platform dependant, so code isn't necessarily portable, right?
Not sure what you mean... Comparing type_info s generated on two different platforms probably won't work, if that's what you had in mind.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
CP SearchBar v2.0.2 released
|
|
|
|
|
Michael Dunn wrote:
Not sure what you mean... Comparing type_infos generated on two different platforms probably won't work, if that's what you had in mind.
Nope. Just that you couldn't rely on certain things about the type_info implementation always being the same across platforms, for example, what typeinfo::name() returns.
My reading of "Design and Evolution of C++" suggests that there is scope for differing definitions of the type_info class on different C++ platforms.
--
Ian Darling
"The moral of the story is that with a contrived example, you can prove anything." - Joel Spolsky
|
|
|
|
|
|
Thanks! Althougth I am not quite sure if I might be able to use it as I hoped, it is still a better alternative then declaring your own Type-Ids.
Aidman » over and out
We haven't inherited Earth from our parents, instead we have borrowed her from our children; an old Indian saying.
|
|
|
|
|
|
I'm a newbie to MFC . Now in my project, I need to implement the spell-checking feature and I have figured out the ASpell is one of the best outthere but I don't know how to implement it in my project. Can someone do me a favour, give me a sample project that use ASpell with MFC.
Thanks a lot .
|
|
|
|
|
|
Hi,
VC6 used a separate set of toolbar settings while debugging. In VS.Net 2003, I just don't get it. Is there any way to get this feature? (If not, I'm going to rant)
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
sighist | Agile Programming | doxygen
|
|
|
|