|
I got your point: By splitting the compound instruction you try (and -in fact - it works) to force the compiler to don't optimize.
But I'm still surprised 'bout the following:
- The compilet was told to "disable optimizations", but was still "optimizing"
- the optimization side effects were out of the optimization scope, treating in fact, a constant as a variable.
I didn't test if(2 & flag) : whould it turn number 2 into 0 and add 0 to every subsecuent x+2? Terrificant!
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Well the compiler will still do some optimising. The real problem probably lays in how it is inlining the code. I do not have the 7.0 compiler, but it would be interesting to see if it would choke on (2 & flag) with your code. I suspect that it would see that and produce the correct inline code instead of what ever it was producing. The only real way to see what it is doing is to look at the asymbly code, before and after modifying the code.
No I do not believe it would turn 2 to 0, every place that 2 is in your code is unique to that piece of code, so subsequent statements where 2 is applied is unique. 2 is a true constant where the variable i was a temporay constant with a specific address location.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi
I use the CreateEnhMetaFile to create an enhanced metafile. The third parameter is the rectangle which give me the sizeo of the metafile. Is it possible to alter that side after
the creation? This will allow me to scale better my metafile. Ideally I am locking for something like:
CMetaFileDC * pDCMetaFile = .....;
pDCMetaFile->CreateEnhanced(p_dc, filename.data(), &rect, NULL);
rect = new sizes;
pcDCMetaFile->alterSize(rect);
Thanks a lot
Always try to keep things as simple as possible
|
|
|
|
|
Not sure what you're trying to accomplish - you can draw a metafile into any size area you desired. The size passed to CreateEnhanced() is more for future reference than anything else, it isn't enforced.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
In the build stage I get these errors
HPMumsCtl.obj : error LNK2019: unresolved external symbol "public: __thiscall CParser::CParser(void)" (??0CParser@@QAE@XZ) referenced in function "public: __thiscall CHPMumsCtrl::CHPMumsCtrl(void)" (??0CHPMumsCtrl@@QAE@XZ)
HPMumsCtl.obj : error LNK2019: unresolved external symbol "public: double __thiscall CvsAwk::GetVal(void)" (?GetVal@CvsAwk@@QAENXZ) referenced in function "public: void __thiscall CHPMumsCtrl::ResolveVariables(char *)" (?ResolveVariables@CHPMumsCtrl@@QAEXPAD@Z)
HPMumsCtl.obj : error LNK2019: unresolved external symbol "public: void __thiscall CvsAwk::SetL(char const *)" (?SetL@CvsAwk@@QAEXPBD@Z) referenced in function "public: void __thiscall CHPMumsCtrl::ResolveVariables(char *)" (?ResolveVariables@CHPMumsCtrl@@QAEXPAD@Z)
.\Debug/NewMumsEngine.exe : fatal error LNK1120: 3 unresolved externals
Although it doesn't show anything while compiling.
I have an instance of Cparser type Compute(Cparse Compute;) in my main class(CHPMumsCtrl).
This Cparser class has a
CvsAwk m_CtrlAwk; declared in its class definition,and also has a #include "vsawk.h"
I am not sure of what this CvsAwk is or does(have a faint idea).Can you please tell me what to do to remove these build errors.As all of them have the same problem,I guess they all have one common error.
Thanks,
Arjun.
Arjun Mukherjee
Software Engineer
Hewlett Packard
|
|
|
|
|
you're missing vsawk.cpp in list of source files in your project,
or you're missing some library where cvsawk is implemented (or this library is not specified in list of libraries to be included while linking)
rrrado
|
|
|
|
|
I want do to a programm which registers all the scrolls of vertical scroll bar from IE.The problem is I cannot catch any scroll message.Thanks.
|
|
|
|
|
Did you try the IHTMLWindow2 -> put_onscroll event handler ?
rrrado
|
|
|
|
|
How can i learn using PerformanceGraph ...it is very important... if you know any document or article!!
|
|
|
|
|
Hi,Everyone:
I got following questions:
1> i want to transform a wave's format to standard format i needed(such as 8000HZ,16 bit,mono,signed) we can use software Goldwave’s “Effects->Resample”. But are there any classes or functions in VC?
2> we aslo want to transform the standard wave (we get from the first step) to A-Law PCM Signals.
How can I realize that in VC? Can any of you give me some threads or links?
Thank you very much!
- - - - - - - - - - - - - - - - - - - - - - - -
Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could!
Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ...
There can be miracles! When you believe, though hope is frail, it's hard to kill!
Who knows what miracles, you can achieve! When you believe, somehow you will ...
YOU WILL WHEN YOU BELIEVE
|
|
|
|
|
Hi all,
I've a MFC dialog with a button and a CTreeCtrl at the dialog.
My dialog is resizable and when resizing the dialog I observe flickering.
First: In the OnPaint() method, I've made a second DC (Device Context) on the memory and disable the WM_ERASEBKGND message.
Second: I fill the DC with the background colour and then I use the BitBlt() method to switch to the memory device context.
Could anyone suggest me how I can make copy of the CTreeCtrl in the memory device context.
Jens
|
|
|
|
|
Hi
(what you're doing sounds a bit elaborate)
If you're only concerned with the flicker, you can set the dialog's style to include WS_CLIPCHILDREN - this way, the dialog and the control don't compete at drawing the same area. Try it and see if this solves your problem.
You can set this property in the Resource Editor too.
HTH
Martin
|
|
|
|
|
Tree controls are a bit tricky to double-buffer, as they occasionally draw outside of WM_PAINT . In controlled situations though, it should be possible. Look into WM_PRINT for a way to force the tree to draw to a specific DC.
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
Hi,
How can one implement calls forwarded to another DLL. For instance, how is it possible to create a DLL that exports symbols forwared to another DLL.
For instance, kernel32.dll exports RtlZeroMemory via a fowarded call to ntdll.dll. Can I make my own DLL export symbols via forwarded calls to other DLL ?
Cheers.
--
Maxime Labelle
maxime.labelle@freesurf.fr
|
|
|
|
|
Hello,
I would like to have 4 examples about odbc, dao, oledb, ado database.
Who can give me those examples or links ?
Thanks in advance.
|
|
|
|
|
This is quite a good article! Enjoy it.
http://www.codeproject.com/database/caaadoclass1.asp[^]
- - - - - - - - - - - - - - - - - - - - - - - -
Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could!
Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ...
There can be miracles! When you believe, though hope is frail, it's hard to kill!
Who knows what miracles, you can achieve! When you believe, somehow you will ...
YOU WILL WHEN YOU BELIEVE
|
|
|
|
|
Is there any example more ?
Thank you.
|
|
|
|
|
|
Thank you very much.
|
|
|
|
|
Can you give me Visual C links ?
Thank you.
|
|
|
|
|
|
|
Hi
I need to ensure that an object of a one of my classes only gets created on the stack as opposed to on the heap using 'new'. Is there a compiler keyword (I'm using VC .net)
or some other method to ensure this.
Thanks
Garf
|
|
|
|
|
I'm not a guru, so take this as a SWAG:
Maybe you could override operator new for your class, and let it throw an exception if invoked?
Or did you mean that operator new should allocate the object on the stack instead of the heap?, in that case, I would say: Not recommendable. (And probably very hard to implement).
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Thanks Jan
I should have mentioned that I was actually looking for a compile time solution.
Serqe's solution seems to be what I was looking for.
Garth
|
|
|
|