|
what kind of solution was that exactly ?
- Malli...!
|
|
|
|
|
|
I use an enumeration.
The if/else or switch code to check the mode is insignificant
relative to the slowness of mouse messages...there's no performance
issues on a modern PC if that's what you're worried about.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm not worried about performance.
I don't want the message handler like a native window proc funciton.
(a big switch)
system
modified on Friday, September 19, 2008 8:34 PM
|
|
|
|
|
My project is SDI that first view is CFromView derive class.
Then I add second view with CScrollView derive class.
In this view I want to print out the data but I don't know how to do that.
Please advise me how can I do.
|
|
|
|
|
Try to associate your 2nd view with the doc at first,
It it very likely to solve the problem.
If your demand is very specific,
try to handle the print message in CView2 by yourself,
you may call CView2::OnDraw in the print handler.
system
modified on Friday, September 19, 2008 5:34 AM
|
|
|
|
|
I copied the Manifest example from the MSDN site, and included it as an XML resource in my code, to represent generic elevated rights. Now, my rc compiler is old, and knows Nothing about XML, but my Linker knows about '.res' files.
Would anyone be willing to compile a Generic Manifest into an rc File for me, so that I can include it in my code.
Anyone willing to assist may contact me at:
bramvankampen@aol.com
Regards,
Bram van Kampen
|
|
|
|
|
Hi all,
Whats the difference between these:
Multi-threaded Debug (/MTd)
Multi-threaded (/MT)
Multi-threaded DLL (/MD)
Multi-threaded Debug DLL (/MDd)
I am currently using
Multi-threaded Debug (/MTd) in my project because I encountered an mfc error message when I used Multi-threaded Debug DLL (/MDd). Please Advise because I haven't seen how it affects my project.
Thanks,
Jayjay
|
|
|
|
|
|
So, I'm trying to track down a bug in an activeX control I'm working on. I'm supposed to be centering text, the text is no where to be seen. Hmm, should be able to find this pretty quick. So, I set a breakpoint at the start of the offending method, walk through the code, all looks well. I hit go, and all is drawn correctly. Hmmm, so I leave the breakpoint off, and now it draws incorrectly.
Then it dawns on me - hit a breakpoint and things draw correctly.
I know debuggers help sometimes by initializing data in debug mode. I've never heard of one doing things when a breakpoint is reached. Any ideas?
Charlie Gilley
Will program for food...
<italic>Hurtling toward a government of the stupid, by the stupid, for the stupid we go. —Michelle Malkin
|
|
|
|
|
charlieg wrote: debuggers help sometimes by initializing data in debug mode.
I don't think debuggers change your data, but debug libraries
may initialize data.
If a breakpoint/run sequence makes something draw correctly, often
it's just a case where you needed to invalidate the window and/or
call UpdateWindow().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
Oh I wish it were so simple as an invalidate. I have had debuggers help me in the past, but this issue just gets weirder.
At this point, I have OnSize, OnPaint and OnDraw. They all call GetClientRect to determine what needs to be drawn. Only OnSize tracks correctly. So, I have something seriously wrong in the control, perhaps a misunderstanding between me, the control and it's container.
cg
|
|
|
|
|
I have some code originally developed in VS6. The boss wants it to run under VS2005, and I found some problems with atof(buffer).
Buffer is read from an ASCII file, and in VS6 everything goes fine, but in VS2005 its messed up:
buffer is "409600.0000"
in watch window atof(buffer) shows value of 409600.00000000
BUT when I assign to a double variable:
DOUBLE variable = atof(buffer) I get 101523136.0000000
Any help fixing this would be appreciated.
|
|
|
|
|
hmm...
What do you get with this:
char charbuffer[] = "409600.0000";
double doublefromchar = atof(charbuffer);
wchar_t wcharbuffer[] = L"409600.0000";
double doublefromwchar = _wtof(wcharbuffer);
TCHAR tcharbuffer[] = _T("409600.0000");
double doublefromtchar = _tstof(tcharbuffer);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Compiler did not like TCHAR
Still get the same results.
When looking at atof() and _wtof() in the watch window, the results are both 409600.0000
The double variables both show 101523136.00000000 in the watch window.
So, the atof() and _wtof() functions seem to work correctly, its just that when the values are assigned to the variables, things are getting messed up.
|
|
|
|
|
FoxholeWilly wrote: Compiler did not like TCHAR
#include <tchar.h>
FoxholeWilly wrote: When looking at atof() and _wtof() in the watch window, the results are both 409600.0000
The double variables both show 101523136.00000000 in the watch window.
That doesn't make sense. How do you watch the functions?
I fired up VS 2005 and wrote this:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#include <stdio.h>
#include <tchar.h>
#include <math.h>
#include <stdlib.h>
int _tmain(int argc, _TCHAR* argv[])
{
char charbuffer[] = "409600.0000";
double doublefromchar = atof(charbuffer);
wchar_t wcharbuffer[] = L"409600.0000";
double doublefromwchar = _wtof(wcharbuffer);
TCHAR tcharbuffer[] = _T("409600.0000");
double doublefromtchar = _tstof(tcharbuffer);
return 0;
}
I can't reproduce anything you are seeing...you've got something
else going on you're not showing us.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
As Mark suggested it is probably a UNICODE issue (VS2005 by default makes UNICODE builds). Could you please post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
note: frequency represents the real-life typedef where the pertinant variable is declared as double.
char buf[80];
FILE* fp;
double frequency;
....
fgets(buf, 80, fp);
frequency = atof(buf);
....
|
|
|
|
|
My Visual Studio 2005 :
The program
#include <stdio.h>
#include <stdlib.h>
void main()
{
char buf[] = "409600.0000";
double frequency;
frequency = atof(buf);
printf("%g\n", frequency);
getchar();
}
The output
409600
What happens if you run this program on your VS2005 ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: What happens if you run this program on your VS2005?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Found the prob. Was missing a header, stdlib.h fixed the problem.
|
|
|
|
|
I am using Visual Studio 2005.
And I want access to unordered_set storage containers.
They are apparently in TR1. whatever that is?
How can I be able to use them in my program?
Thanks
|
|
|
|
|
|
Hi
I'm a novice so excuse the basic questions!
I have Visual Studios 2005
And I want to use <unordered_set>.
Its not included it my list of include files.
Apparently it is in TR1 what ever that menans
How do I go about getting the files so that I can use unordered sets in the code I am trying to write
Many thanks for your time.
|
|
|
|
|
steph5 wrote: I'm a novice
Step 1: Put a subject on your post so people can click on it!
steph5 wrote: And I want to use .
Want to use what?
steph5 wrote: Apparently it is in TR1
I believe TR1 support was first added in the feature pack for Visual Studio 2008.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|