|
Possibly because VC6 is rubbish ? VC7 was a huge jump in standards conformance. It especially sucked at template support.
To get the < to show, check the 'ignore HTML tags' checkbox.
|
|
|
|
|
hello......
i need help for how to read/write file in C++
i use fstream but i wont to open file one time for all functions(file is glopal)
and i wont the file be open in the constructor of my class.
where can i declerd this lines
ftream myfile;
myfile.open(.....,.......);
is it in main or in class?
i have decler in main function but ather function be ERROR.
thanks for all.
|
|
|
|
|
This should be outside of any function or class:
fstream myfile;
This could be at the beginning of main():
myfile.open(.....,.......);
This could be at the end of main():
myfile.close();
Use this in other modules so they know where to link to myfile:
extern fstream myfile;
|
|
|
|
|
You can declare it where-ever you like, but it makes more sense to not hold a file open while your app is running.
Posting some code and error messages would help.
|
|
|
|
|
When I'm using icons in my application, I get a funy dark border around them that results in them having jagged edges, even though their smooth when their placed onto the dialog or elsewhere in the software...any thoughts about how to stop that?
Thanks,
BP
|
|
|
|
|
BlitzPackage wrote: ...I get a funy dark border around them that results in them having jagged edges, even though their smooth when their placed onto the dialog or elsewhere in the software...
Where are they when they have the dark border and jagged edge if they are smooth when you
actually use them?
|
|
|
|
|
When I compile and run the software they show with the dark border and jagged edges. What's causing that?
|
|
|
|
|
BlitzPackage wrote: When I compile and run the software they show with the dark border and jagged edges. What's causing that?
Icons created in VS or at runtime? Bit depth? How are they being used? Are you drawing them?
|
|
|
|
|
I bought them from a site called "Icon Galore". They looked fine and they provided several formats (.ico, .gif, .png), sizes, and bits (8 and 32 bits), with true color, 256 colors, and black and white. The gifs look fine, but of course, I can't use that in VS. I just import them as an icon, and place them on the dialog via the picture control (selecting icon as the type). When I convert them to a bitmap with Corel Draw, the display real smooth except for the fact that it gives them a white background.
What should I do?
Any help or answers you can provide would really be appreciated. Thanks for your time.
Sincerely,
BP
|
|
|
|
|
BlitzPackage wrote: I just import them as an icon, and place them on the dialog via the picture control (selecting icon as the type).
What happens if you add the SS_REALSIZEIMAGE style to the picture control? Just thinking
maybe they get messed up when/if being resized.
|
|
|
|
|
Hmmmm...how do I add that style?
|
|
|
|
|
Highlight the picture control, F4 for properties, set "Real Size Image" property to true;
Note this will clip the icon if your icon is bigger than the picture control but at least
you can see if it draws properly.
|
|
|
|
|
Watch out for using 24 bit icons using a mask/transparent pixel value. That'll never look well. Try to use 32 bit icons with alpha channel present - it produces awesome results.
Also, if you have 32 bit icons - DO NOT open them in Visual Studio. It'll strip out the alpha channel information, making the icons look like crap.
--
Made From Meat By-Products
|
|
|
|
|
How do I ensure that alpha channels are present? Also, how do I use them in my project, but not open them in Visual Studio (which I am using for my project)? By the way, when I convert them into a bitmap (using Corel Draw 11), they are smooth but with a white background. Is there a way I could get rid of that white background?
Thanks for any help you can provide.
Sincerely,
BP
|
|
|
|
|
Hello,
Is it possible to emulate keyboard event (using keybd_event) on the desktop, that is different from active (input) desktop? I.e. I want to create a thread, that calls SetThreadDesktop() and then emulates some keyboard activity on the desktop, whos handle was passed to SetThreadDesktop().
Currently, I have no result until I pass handle of input desktop to SetThreadDesktop().
|
|
|
|
|
Hi,
I am trying to write a stack trace function for an application.
If an exception occurs, I need the stack trace to be printed.
I am using stackwalk64 API to read the stack. But some times
the exception record retreived is improper resulting in inadequate
or junk reports. So I plan to access the stack pointer directly using
Inline Assembly. But the SetUnhandledException
pops the stackframes soon after the crash(before the filter function is called).
So Is there any API which simply notifies the occurence of the exception
without popping the stack soon after the exception occurs.
Thanks in Advance.
-Mathespa
|
|
|
|
|
You're best off just letting the application crash in most cases. Dr. Watson will generate a stack dump and if need be you can configure it to produce a crash dump file which you can load up with WinDBG (and other tools) to get stack traces, examine memory and more. In short you get more functionality for free by not doing anything.
Steve
|
|
|
|
|
When ever i see example and stuff they always use int main() then end with return 0
Whats wrong with just void main()?
Is it just some thing that happened, y'know, one person did it, then a couple, and so on and so forth?
|
|
|
|
|
You might want to return an exit code of some type to a calling or monitoring process.
|
|
|
|
|
The Undefeated wrote: Whats wrong with just void main()?
Absolutely nothing. I use void main( void ) all the time when I am not interested in returning a value or handling any command-line arguments.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Forgiving compiler... the standard actually states that main shall return int. You are however not required to return a value from the main function! If you omit the return statement, it'll default to 0. I thought it was bogus, but the c++ standard says it isn't so.
--
Torn from tomorrow's headlines
|
|
|
|
|
I'm well aware of that. Nine times out of ten, however, I'm not concerned about standards or compliance. When I create a console application, it's just to test a theory, not to create a "real" application.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
From the documentation:
"Alternatively, the main and wmain functions can be declared as returning void (no return
value). If you declare main or wmain as returning void, you cannot return an exit code to the
parent process or operating system using a return statement; to return an exit code when main or
wmain is declared as void, you must use the exit function."
|
|
|
|
|
because void main() is not part of the C++ standard, it is an illegal definition and will not be accepted by a standards-compliant compiler.
|
|
|
|
|
And there you have it.
So in short, you can use void if you want, but you should return an exit code of some sort.
Well, i suppose i should keep using int then
|
|
|
|