|
|
I stand by my original statement, i feel this _should_ be a compiler bug.
I am aware of type promotion rules, but i feel the compiler has more than enough info to 'do the right thing'.
The fact that turning on optimizations will generate correct code somewhat supports this view.
(I know _someone_ will say that even wrong code can produce right results now and then, to which i say )
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote: I know _someone_ will say that even wrong code can produce right results now and then, to which i say
Sorry, I guess I will have to be that someone
Seriously though, officially the code has undefined behavior, which means the C++ standard no longer imposes any requirements on what the code does, and does not require a diagnostic from the compiler. However, it's possible that the specific compiler used may document this behavior, in which case it would be safe to use (on that compiler), or it may issue a warning as a matter of QoI (quality of implementation).
--
Marcus Kwok
|
|
|
|
|
I have two dialogbars. I want docked them on right but in same column. one is on top of another.
lucy
|
|
|
|
|
You could nest them in a single CControlBar which is docked on the right.
|
|
|
|
|
Does anyone know of any image libraries that help aid with image manipulations and comparison. Something simerlar to Aforge but obviously in C++?
|
|
|
|
|
have you tried searching this site ?
|
|
|
|
|
yes but i havent found anything.
|
|
|
|
|
Hi All,
I need to write some application that getting some string and folder and check witch file in this folder ( the file are not Binary file - just text file ) contain the string that i looking.
What i mean is that i don't want to open each file and start to seek for the string.
In the windows search option we have this option to "search word or phrase in the file" - this what i looking for - how to do it with no using windows option.
Thanks for any help.
|
|
|
|
|
First thing you need to do it enumerate the directory for any file type that you are looking for. Use a combination of FindFirstFile() and FindNextFile(). Each file that you find, check the extension for whatever filetypes you want to look in ( ".txt" ). If it's a text file then open the file with CreateFile() or fopen(), read each line and do a string comparison for your string with strstr().
|
|
|
|
|
WalderMort wrote: ...then open the file with CreateFile() or fopen(), read each line and do a string comparison for your string with strstr().
But what about the "i don't want to open each file and start to seek for the string." requirement?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I presumed he meant he didn't want to open every single file with an arbritary file format. If you want to find something inside a file you are going to have to look inside it somehow.
|
|
|
|
|
|
After getting fed up of creating code to center a window correctly, I have finally gotton around to developing a re-usable class to do all the nitty gritty calculations for me. I pass in a desired width and height, it returns a rectangle centered to the screen. Why bother do I hear you say? How often did you take the taskbar into account when positioning a window?
Anyway, regarding the sidebar in vista, and probably XP soon, finding the window and getting it's rectangle is simple enough. But the sidebar comes with other options, like it's ability to always be on top and it's ability to hide ( or rather move of screen ).
Now first proplem, how can I detect if the sidebar is "on top" ( it's pinned to the edge of the screen and all maximized windows maximize to it's edge ) or if it's "on bottom" ( it sit's on the desktop only and other windows may cover it ).
Second, how to detect if it's on the screen, hidden or not it always has a rectangle of the same size. When it's hidden it's rectangle moves/animates off the screen, it's top edge becoming equal to the desktops bottom edge. A simple comparison of those edges should suffice, but what about mulitple-monitor desktops. If the monitors were arranged in such a way that another is below the desktop, it would appear on that monitor.
|
|
|
|
|
NM. The answer was staring me in the face, literally. I was looking in the registry wheras I needed to check for the WS_EX_TOPMOST flag.
While I have this thread though, Can anybody think of any other windows that have a pinning ability and that may effect the correct centering of a window.
|
|
|
|
|
This is just a guess, but the sidebar is probably implemented as an appbar. All appbars have the potential to change the area available on the monitor for other windows. If you always use the work area of a monitor as the rect to center against, your code will always work no matter what app bars are present.
|
|
|
|
|
Thanks for that, and you were right. I simple call to SystemParametersInfo() did the trick.
|
|
|
|
|
Hello
All
I want to copy String table in one application to other application so how string tabe copy to other application.
Thanks And Regards
Atool
Atool
|
|
|
|
|
If by 'string tabe' you mean the string table stored in the resources, then use the resource functions to accquire access to them.
Load the application with LoadLibrary() then find a resource with FindResource() or one of the EnumerateResource***() functions.
|
|
|
|
|
Ohhh no
I want to copy string table manually from one application to other.
Thanks and Regards
Atool
Atool
|
|
|
|
|
what's wrong with a copy and paste? or even open both files in VS and drag the contents over?
|
|
|
|
|
whats the best way to get environmental variables like %windir% %userprofile% and so on?
i've tried the above but vc++ 6.0 dont recognize them when for instance doing something like this:
CString MyVar;
MyVar = "%windir";
MessageBox(MyVar,"titletext");
..returns "%windir%" in the messagebox not "C:"
there may be a simple solution but i cant find it.
anyone?
thanx!
|
|
|
|
|
hobbyprogrammer wrote: whats the best way to get environmental variables like %windir% %userprofile% and so on?
Try GetEnvironmentVariable (VC++) or getenv (C++)
|
|
|
|
|
You need to convert the %***% to a real path before you can use it as a path. Try ExpandEnvironmentStrings()
|
|
|
|
|
Hai all,
class a
{
virtual ~a () { };
}
class b : a
{
~b () {}
}
if a class defined as in above, defined as in below
a *pa = new b ();
delete a;
then, how the virtual table created by compiler for this?
Ravindra M
+919849760694
|
|
|
|