dev-cpp-users Mailing List for Dev-C++ (Page 79)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Per W. <pw...@ia...> - 2006-06-25 19:53:10
|
Note that the tree and btree classes are defined within the namespace aed.
Try writing
aed::tree<int> t;
instead of just
tree<int> t;
If you are new to c++, please google a bit about how to use namespaces in
C++.
/Per W
On Sun, 25 Jun 2006, Marcelo Tom=E1s Gentile wrote:
> Dear reader:
> I have a problem with the archives btree.h and tree.h. These I want them =
to use to program tree structures using devc++ (version 4 or 5). In a progr=
am that uses the archives, I include them within include, for example # inc=
lude <btree.h> or # include <tree.h>. Up to here the program compiles norma=
lly, but when, within main, in the main program, I write tree<int> b, I obt=
ain the following message of error: `tree' undeclared (first use this func=
tion). Send with this email these archives
> The program is
> /////////////////////////////////////////////////////////////////////////=
///////////////////////////////////////////////////////////////////////////=
//////////////////
> #include <stdio.h>
> #include <btree.h>
> #include <tree.h>
> #include <list>
>
> int main(int argc, char *argv[])
> {
> tree<int> t;
> tree<int> :: iterator n;
> btree<int> bt;
> btree<int> :: iterator m;
> system("pause");
> return 0;
> }
>
> /////////////////////////////////////////////////////////////////////////=
///////////////////////////////////////////////////////////////////////////=
///////////////////
>
> I ignore because the error message It would thank for an answer
> Thanks to read to me
> Greetings to all
>
>
>
>
|
|
From: Noorez K. <lor...@ho...> - 2006-06-22 23:32:08
|
I'm trying to create a RichEdit control but the CreateWindow() Function is =
failing. Can someone take a look at it?
=20
HWND edit =3D CreateWindow( "RICHEDIT_CLASS", "", =
WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL=
, 0, 0, 544, 375, hw=
nd, (HMENU)ID_EDIT_CONTROL, gThisInstance, =
NULL );=20
_________________________________________________________________
Try Live.com: where your online world comes together - with news, sports, w=
eather, and much more.
http://www.live.com/getstarted=
|
|
From: Noorez K. <lor...@ho...> - 2006-06-22 04:49:49
|
I have an application that opens up a lot of other child windows. How do I = center these windows to the parent window? _________________________________________________________________ Try Live.com - your fast, personalized homepage with all the things you car= e about in one place. http://www.live.com/getstarted= |
|
From: Daniel K. O. <dan...@gm...> - 2006-06-22 03:15:11
|
Marcos Clapés escreveu: > Anyone knows how to work with DEV C++ and the libraries of COIN3D???. > I'm programming in Windows XP, but i want to translate the code for > differents platforms. > > In the main page of COIN3D (www.coin.org) <http://www.coin.org%29> > it's explained how to work with Microsoft Visual C++ but not for DEV-C++) > > I´m not able to run the most simple program with DEV-C++. Considering that it's a C++ library, you'll have to compile it for your C++ compiler - MinGW. The usual "./configure && make && make install" steps work just fine with MinGW + MSYS (but remember to disable debug info, or the DLL will have 50 MB). I couldn't find any example in the Coin3D page (BTW, it isn't www.coin.org) that didn't require other libraries, so I'm not sure how well it works. But the sample codes that I could dig from the documentation work just fine. I built the DLL with MinGW/GCC 3.4.5 with Dwarf2, so they are incompatible with any previous version - including the MinGW that comes with Dev-C++. If you are interested I can upload my Coin3D binaries somewhere - but first upgrade your compiler to GCC 3.4.5-Dwarf2. --- Daniel K. O. |
|
From: Thymian <Th...@gm...> - 2006-06-22 00:46:12
|
Matthew Little schrieb: > Does anyone know where I can find a good online tutorial for learning > OpenGL using Dev C++? Thanks > The API of OpenGL is language and operating system independend and therefore you should use DevC++ without problems. Maybe this could help you to find the information you are looking for http://en.wikipedia.org/wiki/OpenGL http://de.wikipedia.org/wiki/OpenGL Gruß, Werner |
|
From: Matthew L. <mat...@gm...> - 2006-06-21 20:10:35
|
Does anyone know where I can find a good online tutorial for learning OpenGL using Dev C++? Thanks |
|
From: <mcl...@te...> - 2006-06-21 12:34:07
|
Anyone knows how to work with DEV C++ and the libraries of COIN3D???. = I'm programming in Windows XP, but i want to translate the code for = differents platforms. In the main page of COIN3D (www.coin.org) it's explained how to work = with Microsoft Visual C++ but not for DEV-C++) I=B4m not able to run the most simple program with DEV-C++. Perhaps someone has experience in that. Thanks in advance, Marcos. |
|
From: Cromwell E. <sp...@ya...> - 2006-06-19 22:36:14
|
--- Aurimas Äernius wrote:
> Hi,
Hello!
> > what happens if, when a running for_each, you
> > need to change the iterators that you originally
> > passed, from within the function that you call?
> >
> > specifically, what if the list changes size?
>
> If you add or remove elements from the list, all
> iterators become invalid. Of course you can try
> using them and you might succeed, but shouldn't
> do that. Just think that after any insertion or
> removal all iterator don't work anymore.
Only for certain containers (i.e. std::vector). For
std::list or std::set only the iterator pointing to
the element just removed becomes invalid.
Cromwell D. Enage
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
From: <au...@gm...> - 2006-06-19 21:10:47
|
Hi, > what happens if, when a running for_each, you need to change the > iterators that you originally passed, from within the function that > you call? > > specifically, what if the list changes size? If you add or remove elements from the list, all iterators become invalid. Of course you can try using them and you might succeed, but shouldn't do that. Just think that after any insertion or removal all iterator don't work anymore. -- Aurimas |
|
From: Erik S. <esc...@gm...> - 2006-06-19 20:21:06
|
what happens if, when a running for_each, you need to change the iterators that you originally passed, from within the function that you call? specifically, what if the list changes size? |
|
From: Erik S. <esc...@gm...> - 2006-06-17 22:34:51
|
how does one embed perl in a c++ program? |
|
From: Eric R. <eri...@cl...> - 2006-06-17 22:26:16
|
// it still could do with a change,
#include <iostream>
using namespace std;
int in_A;
int in_B;
int and_gate(void);
int main (void)
{
int choice;
std::cout << "Enter 1 to try the AND gate functions " << std::endl ;
std::cin >> choice;
if (choice ==1)
{
and_gate();
}
return 0;
}
int and_gate(void)
{
std::cout << "input Gate A, enter 1 or 0, enter 2 to end program" << "
" ;
std::cin >> in_A ;
std::cout << "input Gate B, enter 1 or 0, enter 2 to end program" << "
" ;
std::cin >> in_B ;
if (in_A==2 || in_B==2)
{
return 0;
}
if (in_A==1&& in_B==1)
{
std::cout << std::endl << "Output is logic one" << std::endl ;
}
else
{
std::cout << std::endl << "Output is logic zerro" << std::endl ;
}
system("PAUSE");
and_gate();
}
----- Original Message -----
From: Josh Matthews
To: Dev-Cpp UserList
Sent: Sunday, June 18, 2006 2:58 AM
Subject: Re: [Dev-C++] you will never belive this
First off, C++ doesn't use .h headers anymore. You want <iostream>, and
then you need to either replace cout with std::cout, and endl with
std::endl, or else you need to add a "using namespace std;" line after the
#include line.
And please please please don't call main() recursively, that's just asking
for trouble. Use an infinite loop and break out of it instead.
On 6/17/06, Eric Richards <eri...@cl...> wrote:
Some months ago I did a google search on logic gates and found lots of
errors out there on the web, so I thought I would make my own page (without
errors), then just because I thought it would be interesting thought I would
have a bit of code to do the same thing as logic gate, here is the code
below,
The strange thing was it worked first in version 4.9.9.1 then it stopped
working and refused to compile and run. Then I put the same code into
version 4.9.9.0 and it worked again.
I tried to get the BOOL to work in place of INT but I did not have much
luck, (that was when version 4.9.9.1 stopped working) then I thought I
wonder if I could get the code to throw a exception error if you enter a
number other than 0 or 1 so the DOS type screen shuts off after doing a
return 0;
#include <iostream.h>
int in_A;
int in_B;
int main ()
{
cout << "input Gate A, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_A ;
cout << "input Gate B, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_B ;
if (in_A==2 || in_B==2)
{
return 0;
}
if (in_A==1&& in_B==1)
{
cout << endl << "Output is logic one" << endl ;
}
else
{
cout << endl << "Output is logic zerro" << endl ;
}
system("PAUSE");
main();
}
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Cheers,
Josh
PGP: http://revvy.box43.net/Josh_Matthews.asc
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Eric R. <eri...@cl...> - 2006-06-17 20:06:11
|
Thanks Josh
I just remembered I think
int main ()
has been replaced with
int main (void) or something since I have been to C++ school
----- Original Message -----
From: Josh Matthews
To: Dev-Cpp UserList
Sent: Sunday, June 18, 2006 2:58 AM
Subject: Re: [Dev-C++] you will never belive this
First off, C++ doesn't use .h headers anymore. You want <iostream>, and
then you need to either replace cout with std::cout, and endl with
std::endl, or else you need to add a "using namespace std;" line after the
#include line.
And please please please don't call main() recursively, that's just asking
for trouble. Use an infinite loop and break out of it instead.
On 6/17/06, Eric Richards <eri...@cl...> wrote:
Some months ago I did a google search on logic gates and found lots of
errors out there on the web, so I thought I would make my own page (without
errors), then just because I thought it would be interesting thought I would
have a bit of code to do the same thing as logic gate, here is the code
below,
The strange thing was it worked first in version 4.9.9.1 then it stopped
working and refused to compile and run. Then I put the same code into
version 4.9.9.0 and it worked again.
I tried to get the BOOL to work in place of INT but I did not have much
luck, (that was when version 4.9.9.1 stopped working) then I thought I
wonder if I could get the code to throw a exception error if you enter a
number other than 0 or 1 so the DOS type screen shuts off after doing a
return 0;
#include <iostream.h>
int in_A;
int in_B;
int main ()
{
cout << "input Gate A, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_A ;
cout << "input Gate B, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_B ;
if (in_A==2 || in_B==2)
{
return 0;
}
if (in_A==1&& in_B==1)
{
cout << endl << "Output is logic one" << endl ;
}
else
{
cout << endl << "Output is logic zerro" << endl ;
}
system("PAUSE");
main();
}
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Cheers,
Josh
PGP: http://revvy.box43.net/Josh_Matthews.asc
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Josh M. <mrl...@gm...> - 2006-06-17 14:58:50
|
First off, C++ doesn't use .h headers anymore. You want <iostream>, and
then you need to either replace cout with std::cout, and endl with
std::endl, or else you need to add a "using namespace std;" line after the
#include line.
And please please please don't call main() recursively, that's just asking
for trouble. Use an infinite loop and break out of it instead.
On 6/17/06, Eric Richards <eri...@cl...> wrote:
>
> Some months ago I did a google search on logic gates and found lots of
> errors out there on the web, so I thought I would make my own page
> (without
> errors), then just because I thought it would be interesting thought I
> would
> have a bit of code to do the same thing as logic gate, here is the code
> below,
>
> The strange thing was it worked first in version 4.9.9.1 then it stopped
> working and refused to compile and run. Then I put the same code into
> version 4.9.9.0 and it worked again.
>
> I tried to get the BOOL to work in place of INT but I did not have much
> luck, (that was when version 4.9.9.1 stopped working) then I thought I
> wonder if I could get the code to throw a exception error if you enter a
> number other than 0 or 1 so the DOS type screen shuts off after doing a
> return 0;
>
>
>
>
>
> #include <iostream.h>
> int in_A;
> int in_B;
>
> int main ()
> {
>
>
> cout << "input Gate A, enter 1 or 0, enter 2 to end program" << " "
> ;
> cin >> in_A ;
>
> cout << "input Gate B, enter 1 or 0, enter 2 to end program" << " "
> ;
> cin >> in_B ;
> if (in_A==2 || in_B==2)
> {
> return 0;
> }
>
>
> if (in_A==1&& in_B==1)
> {
> cout << endl << "Output is logic one" << endl ;
> }
> else
> {
> cout << endl << "Output is logic zerro" << endl ;
> }
> system("PAUSE");
> main();
>
>
> }
>
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
--
Cheers,
Josh
PGP: http://revvy.box43.net/Josh_Matthews.asc
|
|
From: Eric R. <eri...@cl...> - 2006-06-17 13:07:01
|
Some months ago I did a google search on logic gates and found lots of
errors out there on the web, so I thought I would make my own page (without
errors), then just because I thought it would be interesting thought I would
have a bit of code to do the same thing as logic gate, here is the code
below,
The strange thing was it worked first in version 4.9.9.1 then it stopped
working and refused to compile and run. Then I put the same code into
version 4.9.9.0 and it worked again.
I tried to get the BOOL to work in place of INT but I did not have much
luck, (that was when version 4.9.9.1 stopped working) then I thought I
wonder if I could get the code to throw a exception error if you enter a
number other than 0 or 1 so the DOS type screen shuts off after doing a
return 0;
#include <iostream.h>
int in_A;
int in_B;
int main ()
{
cout << "input Gate A, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_A ;
cout << "input Gate B, enter 1 or 0, enter 2 to end program" << " " ;
cin >> in_B ;
if (in_A==2 || in_B==2)
{
return 0;
}
if (in_A==1&& in_B==1)
{
cout << endl << "Output is logic one" << endl ;
}
else
{
cout << endl << "Output is logic zerro" << endl ;
}
system("PAUSE");
main();
}
|
|
From: Per W. <pw...@ia...> - 2006-06-15 05:14:09
|
Updating symbols on screen every 16 ms represents 60 Hz frame rate. FPS (Frames/Per Second) games often work in this range. They do it by using DirectX and by hogging 100% CPU. They do not idle between updates. They evaluate game logic, update display, evaluate game logic, update display, ... Normally no sleep waiting for any tick events, and they only work well while having focus - Windows allows the currently focused application to hog the CPU a lot harder than other programs. Note that Windows installations normally uses time ticks of 16-64 ms for task scheduling. This means that when several threads runs at the same priority, a round-robin scheduling results in non-sleeping threads to have to wait for one or more full time slices before receiving CPU time again. In short - unless every other thread in the machine is either most of the time idling or running at lower priorities, a thread can not execute in every time slice. Animating symbols on screen is better handled at 5 Hz, i.e. 200 ms timer ticks in the user interface (UI) thread. Actual data gathering should be performed in a worker thread with suitable priority, unless the update speed - and amount of work - is low enough that it can be done in a tick handler without affecting performance of the application. Preferably, the work thread should also regularly sleep - unless it will automatically sleep while waiting for file or communications data. The only users who accept a program running constantly at 100% are game players, scientists and some R&D people. An application that always run full-time is more or less unusable on a laptop, even if the job is run at a lower priority. The cooling in laptops isn't built for constant use at max CPU load because of the miniscule fans and heatsinks. Even for office machines, the noise level will normally increase significantly since power supply and processor fans will have to run at elevated speeds. In short: settle for 5 or possibly 10 Hz animation speed for the tick data, and settle for maybe 1 or 2 Hz "game logic" speed. The users will have a hard time trying to read the data and react to more than 2 or 3 changed numeric values anyway, so higher "game logic" speed will not allow a stock trader to react any fster to an event. If this isn't a dedicated machine running tick information at a stock exchange or similar, it might even be enough to evaluate what data to display every 2-5 seconds, without users noticing any slowness in the system. The best kind of programs are the "invicible" programs. You get the benefits of the program without really noticing that it is there. If it is a desktop application, the only reason you should know that the application is running is that you can read the output. As soon as a program starts to consume enough CPU or memory resources to affect other programs or responsiveness of the machine, people will start to dislike it unless the machine is specifically bought for the job. A CAE system is normally built specifically for the task, so people find it normal if it takes minutes or hours to simulate accoustic behaviour in concert halls, turbulence around wing tips of airplanes or if image processing of space photos is run as non-interactive batch jobs. /Per W On Wed, 14 Jun 2006, Bin Zhou wrote: > > Thanks for the message. I do not think the feature was used correctly in our > implementation. The system is a Win fat client to show stock tick data. > Internally a data cache is used to store tick information for registered > stock symbol. Once there is any tick data update, cached data will be > updated. The timer is used by the user interface elements to read data again > from the cache every 16 milliseconds. Also, some calculated results using > the tick data will be published to message Q triggered at some intervals set > through another timer event. Now I found the UI is extremely non-responsive. > Clicking with mouse to select a UI element takes long time and during which > the screen seems to be frozen. I think the design tried to avoid using > multiple thread, but did not consider much on the impact flushing the timer > with so high a frequent messages. > > Thanks, > > Bin > > -----Original Message----- > From: Per Westermark [mailto:pw...@ia...] > Sent: Wednesday, June 14, 2006 6:29 PM > To: Bin Zhou > Cc: dev...@li... > Subject: Re: [Dev-C++] Using MFC Timer Framework > > You can't have events every 1 ms using the normal timers. > > The timer events does not stack but gets lost. > > Windows makes use of callbacks and messages to perform most of it's actions. > The timers doesn't run in own threads. > > I don't know what you want to do, but windows is basically not designed to > trigger actions every 1 ms. Some things - for example sound - may use > hardware acceleration with buffering. > > One thing to look into a bit more are the multimedia timers available in > Windows. They have better priority and granularity. However - don't abuse > them. Make sure that the application really, really need high-speed timers > before continuing with the coding! > > /Per W > > On Wed, 14 Jun 2006, Bin Zhou wrote: > > > Hi, > > > > I was just assigned to work on a MFC application using the MFC Timer > > framework. Basically the application sets up several timer events. One > > event is set to run every one millisecond. Because of the machine > > constraints, it actually may get kicked off every 17 milliseconds if > > no other things running. However, when some other operations of the > > application are running, those other things may jump into the way. My > questiona are: > > > > 1. whether each Timer event is set up to run in its own thread. > > 2. if the timer triggered event takes longer to finish than the time > > off value set, what will happen. Will those event be pilled up in the > > message queue so that once the application gets a chance, it will go > > back to pick them up. > > > > Thanks, > > > > Bin Zhou > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Bin Z. <bin...@ho...> - 2006-06-15 02:59:15
|
Thanks for the message. I do not think the feature was used correctly in our implementation. The system is a Win fat client to show stock tick data. Internally a data cache is used to store tick information for registered stock symbol. Once there is any tick data update, cached data will be updated. The timer is used by the user interface elements to read data again from the cache every 16 milliseconds. Also, some calculated results using the tick data will be published to message Q triggered at some intervals set through another timer event. Now I found the UI is extremely non-responsive. Clicking with mouse to select a UI element takes long time and during which the screen seems to be frozen. I think the design tried to avoid using multiple thread, but did not consider much on the impact flushing the timer with so high a frequent messages. Thanks, Bin -----Original Message----- From: Per Westermark [mailto:pw...@ia...] Sent: Wednesday, June 14, 2006 6:29 PM To: Bin Zhou Cc: dev...@li... Subject: Re: [Dev-C++] Using MFC Timer Framework You can't have events every 1 ms using the normal timers. The timer events does not stack but gets lost. Windows makes use of callbacks and messages to perform most of it's actions. The timers doesn't run in own threads. I don't know what you want to do, but windows is basically not designed to trigger actions every 1 ms. Some things - for example sound - may use hardware acceleration with buffering. One thing to look into a bit more are the multimedia timers available in Windows. They have better priority and granularity. However - don't abuse them. Make sure that the application really, really need high-speed timers before continuing with the coding! /Per W On Wed, 14 Jun 2006, Bin Zhou wrote: > Hi, > > I was just assigned to work on a MFC application using the MFC Timer > framework. Basically the application sets up several timer events. One > event is set to run every one millisecond. Because of the machine > constraints, it actually may get kicked off every 17 milliseconds if > no other things running. However, when some other operations of the > application are running, those other things may jump into the way. My questiona are: > > 1. whether each Timer event is set up to run in its own thread. > 2. if the timer triggered event takes longer to finish than the time > off value set, what will happen. Will those event be pilled up in the > message queue so that once the application gets a chance, it will go > back to pick them up. > > Thanks, > > Bin Zhou |
|
From: Per W. <pw...@ia...> - 2006-06-14 22:29:11
|
You can't have events every 1 ms using the normal timers. The timer events does not stack but gets lost. Windows makes use of callbacks and messages to perform most of it's actions. The timers doesn't run in own threads. I don't know what you want to do, but windows is basically not designed to trigger actions every 1 ms. Some things - for example sound - may use hardware acceleration with buffering. One thing to look into a bit more are the multimedia timers available in Windows. They have better priority and granularity. However - don't abuse them. Make sure that the application really, really need high-speed timers before continuing with the coding! /Per W On Wed, 14 Jun 2006, Bin Zhou wrote: > Hi, > > I was just assigned to work on a MFC application using the MFC Timer > framework. Basically the application sets up several timer events. One event > is set to run every one millisecond. Because of the machine constraints, it > actually may get kicked off every 17 milliseconds if no other things > running. However, when some other operations of the application are running, > those other things may jump into the way. My questiona are: > > 1. whether each Timer event is set up to run in its own thread. > 2. if the timer triggered event takes longer to finish than the time off > value set, what will happen. Will those event be pilled up in the message > queue so that once the application gets a chance, it will go back to pick > them up. > > Thanks, > > Bin Zhou |
|
From: Bin Z. <bin...@ho...> - 2006-06-14 20:21:22
|
Hi, I was just assigned to work on a MFC application using the MFC Timer framework. Basically the application sets up several timer events. One event is set to run every one millisecond. Because of the machine constraints, it actually may get kicked off every 17 milliseconds if no other things running. However, when some other operations of the application are running, those other things may jump into the way. My questiona are: 1. whether each Timer event is set up to run in its own thread. 2. if the timer triggered event takes longer to finish than the time off value set, what will happen. Will those event be pilled up in the message queue so that once the application gets a chance, it will go back to pick them up. Thanks, Bin Zhou |
|
From: Richard H. <rf...@ya...> - 2006-06-12 20:24:34
|
More to the point about the supposed definition of operator bool() in template class basic_istream (in header file <istream> -- mingw distribution) is that, upon reexamination, it appears that bool() is actually defined in a nested class "basic_istream<_CharT, _Traits>::sentry" of class basic_istream<_CharT, _Traits>. I didn't know there was any such thing as a nested class in C++, but it looks like there is (upon comparison of the syntax with the Internet document entitled "Working Draft, Standard for Programming Language C++"). I don't know what the visibility characteristics of such a bool() operator are. So it looks like maybe Greg Chicares is right about the implicit conversion via std::basic_ios::operator!(). Maybe someone can clarify this. On the other hand, if the bool() operator is effectively defined automatically as a member also of class basic_istream<_CharT, _Traits>, then it looks like it gets inherited by class basic_ifstream<_CharT, _Traits> (note the "f") and that ifstream is defined by typedef as basic_ifstream<char> (I'm not sure what happens with the omitted second template argument; this seems to be a matter of C++ specs more recent than the versions I've studied). So it looks like __maybe__ the bool() operator instantiated in basic_istream<char>::sentry from the template nested class basic_istream<_CharT, _Traits>::sentry is the cast operator that gets executed in the expression "(bool)getline(is,linebuf)". Richard Haney __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Richard H. <rf...@ya...> - 2006-06-11 23:14:43
|
It now appears that the problem discussed in the message "Bug report:
problems with gdb & <string>'s getline" I sent yesterday (to
min...@li... ) is not a problem with gdb or
<string>'s getline.
But rather the problem appears to be with the seemingly arbitrary,
capricious way that Dev-C++ switches the working directory from my
normal project directory to C:\Dev-Cpp when the debugger is invoked. I
suspected that this might be happening when I reflected on earlier
experience with mpatrol which I used when I thought the problem might
be due to a memory bug (because the errors only occurred when I invoked
the debugger in Dev-C++). In that earlier experience I found that
mpatrol.log was written to my normal project directory when I executed
the application without invoking the debugger. But when I invoked the
debugger for the project in Dev-C++, I found that mpatrol.log was
written to C:\Dev-Cpp, where, incidentally the project's .dev file
(which presumably contains all the settings for the project) is stored.
Incidentally, the problem does not arise when I invoke gdb and the
application together in a cygwin-bash command-processing window. (I
verified with 'which' and 'where' commands that the gdb in
C:\Dev-Cpp\bin is the one that is used and in fact the only gdb that is
visible.)
I verified that Dev-C++'s working directory is C:\Dev-Cpp (when the
debugger is invoked) by copying "getline_input.txt" to C:\Dev-Cpp and
testing the operation of Dev-C++ with the debugger and the test
application both before and after I copied the file. The Dev-C++ setup
works as expected after copying the file.
It would be nice if there were some way of setting the working
directory in the Dev-C++'s project's dialog boxes and perhaps even
having the default directory for the .dev project file be independent
(after initial project setup) of the default directory for other files
to be opened with "Alt-F ....".
Also, it would be nice if the "Send command to GDB" input control in
the "Debug > Output" tab at the bottom of the screen were functional.
If that control were operable, theoretically at least, one could send a
"cd ...." command to gdb to set the working directory, although it
would be a bit of a nuisance to have to do this every time the debugger
is started.
The foregoing problem of switched directories never arose in earlier
development because, in normal execution, the attempt to open the
relevant file only occurred if the relevant file existed the current
working directory and the Windows Explorer context window were opened
to select the application for that file, and, furthermore, other IDEs I
used never made such a capricious switch of the working directory as
Dev-C++ does.
But to protect myself from Dev-C++'s capriciousness I replaced the
"is.clear();" statement (in the test example), which really wasn't
needed anyway, with:
if(!is.good()){
cerr << "File '" << filename << "' not found." << endl;
system("PAUSE");
return EXIT_FAILURE;
}
And in the original application, where I first discovered this problem,
I replaced the "is.clear();" statement with:
if(!is.good())
throw e_heading_error((string)"File '" + filename + "' not
found.");
Finally, it would be nice if the debugger in Dev-C++ could be made to
stop skipping display-updates of steps executed. The display-update
skipping tends to be rather bedeviling at times.
Richard Haney
P.S.:
In reply to my
> ifstream is(filename);
[...]
> string linebuf;
> bool sentry_state;
[...]
> while(sentry_state = (bool)getline(is, linebuf)){
--- Greg Chicares <chi...@co...> wrote:
<quote>
I'm not really sure what this does. Try rewriting it in a
more conventional way; does the problem remain?
Consider:
while(getline(is, linebuf))
IIRC, that works because of an implicit conversion via
std::basic_ios::operator!() that just calls fail(). [...]
<endquote>
Actually there now seems to be a definition of operator bool() in
template class basic_istream (defined in header <istream>), and istream
is simply defined in header <iosfwd> by "typedef basic_istream<char>
istream;"; so the (bool) cast above was to be sure I was getting the
sentry state and not depending on some indirect, unknown-to-me
conversion operation. But I suppose the bool() operator would be used
even in implicit conversion because that seems to be the most direct
conversion possible.
Thanks for the suggestions as to hints for useful debugging techniques.
Even though the general source of the problem seems now to be
resolved, these suggestions should prove useful in other contexts.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
From: Daniel K. O. <dan...@gm...> - 2006-06-11 01:25:52
|
Erik Schmidt escreveu: > is there a way to get an iterator to a specific point in a vector? > If your "specific point" can be found through an index, you can try: int i = ...; vector<whatever>::iterator it = container.begin(); advance(it, i); This also works for other containers; if you want to make sure your code only works with random access iterators, you can just use it+=i. More details here: http://www.roguewave.com/support/docs/sourcepro/edition9/html/stdlibref/advance.html --- Daniel K. O. |
|
From: Erik S. <esc...@gm...> - 2006-06-09 22:08:37
|
is there a way to get an iterator to a specific point in a vector? |
|
From: Per W. <pw...@ia...> - 2006-06-09 13:15:59
|
Actually, the two-complement format (that only stores one zero) uses the extra value to store an extra negative value. A two-bit signed integer would store the values -2, -1, 0, 1. /Per W On Fri, 9 Jun 2006, [ISO-8859-15] G=F6sta Ljungdahl wrote: > One bit is consumed by the sign (+ or -) which means that if the > variable is signed it's maximum absolute value is "about" half that of a > corresponding unsigned variable. An example explained the "about": > Two bit integer > 00 01 10 11 > > unsigned > this would be: > 0 1 2 3 > > signed > assuming MSB contains the sign and + <-> 1 this would be: > -0 -1 +0 +1 but since we only need one zero one normally does something > like this: > -1 0 +1 +2 that is -0 is taken to mean +2 and +0 is taken to mean 0 > hence the "about". > > > > > > > Erik Schmidt skrev: > > what's the difference between a signed and unsigned variable > > > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <go...@fo...> - 2006-06-09 09:53:45
|
One bit is consumed by the sign (+ or -) which means that if the variable is signed it's maximum absolute value is "about" half that of a corresponding unsigned variable. An example explained the "about": Two bit integer 00 01 10 11 unsigned this would be: 0 1 2 3 signed assuming MSB contains the sign and + <-> 1 this would be: -0 -1 +0 +1 but since we only need one zero one normally does something like this: -1 0 +1 +2 that is -0 is taken to mean +2 and +0 is taken to mean 0 hence the "about". Erik Schmidt skrev: > what's the difference between a signed and unsigned variable > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |