|
Hello David
Thanks for the reply. You're right the value is exceeding the range an integer can hold. But is there any way to solve my problem of setting time intervals.
If any one knows how to solve it, pls help.
Thanks
Hari.
|
|
|
|
|
Set the timer for one minute, and then each time the event is signaled (or the completion routine is called), increment a counter. When the counter is four, you know that four minutes have elapsed.
|
|
|
|
|
Hello David
Thanks for the reply, Using a counter solved the problem
Hari.
|
|
|
|
|
hi!
several days ago,I wrote my program with seh filter function using "_set_se_translator()",the debug version worked well as my expectation that it turned to my own exception filter specified in _set_se_translator() when the exception happened;but the release version did it as if there was no try_catch statement.why?
thanks!
|
|
|
|
|
You need to provide a bit more context about your code.
That said, I ran into something similar which may be the problem you're having. I had code similar to this:
int* pi = NULL;<br />
int i = *pi;
In debug builds, an exception was thrown from my SE handler and caught, but not in release builds. As it turned out, in release builds, the optimiser was correctly removing this code because it had no effect.
Not sure what you're doing, but if it's simple test case like mine, you might want to turn off the optimiser for that block of code:
#pragma optimize("", off)
Brad
|
|
|
|
|
I have a problem.there is a parent dialog, load two modeless dialog through the TAB control attached, only one modeless dialog show real-time,for don't move the modeless dialog in the tab controls,so the modeless dialog has only a Client,has no title bar.
When handle a button 's clicked command message in parent dialog, I want to trig a modeless dialog's button clicked event.So send message to the destination dialog e.g SendMessage(hModelessDialogWnd,WM_COMMAND,(WPARAM)IDC_BUTTONINMODELESS,0,0),but the destination show modeless dialog don't get the mesage and handle it.
1.How to get the handle of modeless dialog,beause the modelsess dialog has no title bar.
2.I attempt many method to get modeless dialog's pointer or handle.but debug it find don't get the modeless dialog's handle.
|
|
|
|
|
Hi,
is it necessary to initiate or reset LPTSTR zBuffer to zero after it was filled with a value?
Thanks, Mark
|
|
|
|
|
???
Don't try it, just do it!
|
|
|
|
|
zBuffer = 0; right??
Thanks, Mark
|
|
|
|
|
Yes, now you have given zBuffer the value 0.
If that makes any sense cant de deduced from what you have posted, as you failed to give any sort of helpful information.
So I think you know what you are doing.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I already created a SDI containg a dialog X with listbox, buttons..etc. Realise that i need a database as well, how do i start creating one and incorporate it into my SDI application? The interface dialog (for user to key in data) for this database will appear only when a specific button is pressed in dialog X. Urgent!
|
|
|
|
|
The easiest way is to create another SDI application with database support and note what gets added to the project. Add those items to your application. The biggest item will be a class derived from CRecordset .
|
|
|
|
|
Hey All,
Just wondering if anybody knows how to go about modifiying the http request header just before it's sent to the server. If I have an app with a CHttpView how would I go about viewing and modifying the header after somebody clicks on a link but before it's sent to the webserver.
I'm not exactly sure if OnBeforeNavigate2 is the one I should be using and I'm not sure how I go about modifying the Header (specifically the values that are "posted" to the server from a form (Is it CHttpArgList that I need to be dealing with?)).
Thanks in advance for any help lads.
Regards,
Brian Dela
IE 6 required: http://www.briandela.com[^] It works now.
|
|
|
|
|
1. Does anyone know if using templates causes classes to run slower in time versus there non-templated counter parts?
2. As I understand that templates allow for portability, is it wise to use them for time critical operations (eg. graphics processing, DSP, etc.)?
3. Are the STL classes fast?
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
|
|
|
|
|
RichardS wrote:
1. Does anyone know if using templates causes classes to run slower in time versus there non-templated counter parts?
The overhead for templates is at compile time. It manifests itself in two ways:
1/ slower build times
2/ code bloat
Slower Build Times for the most aren't a real problem, but with some libraries there may be a noticable slowdown. I noticed this mostly when dealing with boost::function. However, the benefits you get from templates far outweigh this in my opinion.
Code Bloat is caused by repeated instantiation of different types of templates making your compiled products bigger.
As for whether templates can make code faster at runtime, they can, but only if you are prepared to make sacrifices in other areas. For example, sometimes you can avoid the use of virtual functions altogether by using templates, which in tight inner loops may give you the speed increase you need.
Another area templates can make a significant performance difference is in compile time calculations - many matrix math libraries now use templated proxy classes to minimise copies.
Templates certainly shouldn't be any slower at runtime than normal classes, because they will eventually be converted to standard classes ( well, sort of ). It's certainly a matter of picking the right tools for the job.
RichardS wrote:
2. As I understand that templates allow for portability, is it wise to use them for time critical operations (eg. graphics processing, DSP, etc.)?
Again, performance depends on the situation, if you can prevent extra copies (look for information on Expression templates, or look at the code for boost::lambda or boost::ublas for good examples), you are likely to get significant speed improvements. If you need to matrix math (DSP) you may well get that extra performance you need.
Portability (as in operating system portability) is more generally supported by the use of the preprocessor, but it should be possible to use template specialisations to do the same thing - but I don't know if it would be worth the effort.
RichardS wrote:
3. Are the STL classes fast?
The STL classes were designed to be generic containers, so they aren't optimal in all situations. For most applications the effort and risk of writing and debugging custom containers is probably higher than that of using the STL. If you're sensible with the containers you can get extremely good performance out of them, eg/ store pointers (or even better, boost::shared_ptr's) to minimise the cost of copying containers. Also make sure you select the appropriate container for the job.
The STL learning curve isn't as steep as many other API's, and I strongly recommend this as a good way to get into using writing generic code. What you will find is that writing good generic code is harder than writing non-generic code, but it's (generally )almost as easy to use.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Thank-you for your response.
Andrew Walker wrote:
1/ slower build times
2/ code bloat
If these are the main 2 time factors templates seem quite good.
For templates I generally use Explicit Instantiation of the template class which seems to aid in the compile and link times (although for big projects this leads to handling a large number of template instaniations).
Andrew Walker wrote:
Portability (as in operating system portability) is more generally supported by the use of the preprocessor, but it should be possible to use template specialisations to do the same thing - but I don't know if it would be worth the effort.
Oops, I was more thinking along the lines of reuse. We do work in embedded controllers in which each platform has different hardware, so code is ported and reused on each platform. Thus template's would allow us to extend products with out hampering previous released platforms.
You seem to speak quite an indepth knowledge of the boost library. Is it good for speed?
Rich
"Programming today is a race between software engineers striving to build bigger and better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
|
|
|
|
|
The boost library is a lot like STL; it is very efficient if you use it right, but it will also allow you to efficiently specify very inefficient solutions.
The problem with the boost library and embedded systems is generally not efficiency but compiler limitations. Lots of embedded systems don't have good compilers, and parts of boost depend on the compiler being very up to date and complete in the implementation of the C++ standard. That said, one of the boost reference platforms is the gcc compiler which gets used a lot for cross-compiling, so if you are using that you should be OK.
|
|
|
|
|
Hi all
I import a Dialog and its cpp and .h from other workspace, but when i open the classwizard, i can not find the Dialog's class name in Class Name.
what happend?
|
|
|
|
|
You did include it in your project?
Then try do close the IDE, delete your *.ncb-file in your project directory, re-open the IDE and open the classbrowser. Now it must be there, because the class wizard database had been rebuild.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
You might also have to delete the project's .CLW file.
|
|
|
|
|
Close VC++
go and delete the "NameOfProject.clw" in the Projects directory..
then open VC++
open the project
open ClassWizard it will ask you if you want to rebuild the "NameOfProject.clw"
just do it and it will give you what you want
|
|
|
|
|
Hi all,
I developed an application with MFC using SQL server datatbse.. This appliaction runs fine on my machine having windows 2000 Pro.. I am getting an error while running the same applicaiton on any fresh machine...The error i am getting is
Specified SQL server not found
ConnectionOpen (CreatFile())...as far as i can guess this is the problem because there is no SQL server driver installed on fresh machines..what should i do to make it run any machine...i mean is there any way out so that i dont have to install anything else then to run my applicaiton on client side..and it does all.. any help or pointers are highly appreciated..
thanks a lot in advance..
regards,
Himanshu
|
|
|
|
|
You've not shown the actual code that is in error so help is going to be minimal, if at all.
Is the application using ODBC?
|
|
|
|
|
hi,
thanks for the reply...yes i am using ODBC in my application...I am trying to install MDAC with the application..now it seems to work fine on other machines where it already doesn't have MDAC..if it has it shows an error again..is there any solution to it???
Please reply???it's very urgent...thanks a lot in advance..
regards
Himanshu
|
|
|
|
|
Well, I was going to suggest updating the SQL ODBC drivers but that may not do it. If your program works fine on machines without MDAC installed and produces an error on machines with MDAC installed, I'm at a loss.
|
|
|
|