|
Thant depends on what you want. If you want that your output doesn't hang around in some buffer, use endl . If you can afford that your output doesn't become visible right away, use "\n".
Consider the following piece of code:
<br />
for( int i = 0; i < 1000; i++ )<br />
{<br />
std::cout << i << std::endl<br />
<< OtherOutput << std::endl;<br />
}<br />
std::cout << "Finished" << std::endl;<br />
The above code snippet is not very optimized. It has to wait for the ouput to flush all the data at every endl! So in this loop you take a great performance hit. The next code snippet is better:
for( int i = 0; i < 1000; i++ )
{
// some heavy calculation
std::cout << i << "\n"
<< OtherOutput << "\n";
}
std::cout << "Finished" << std::endl;
This code runs faster and it flushes the output buffer only when needed (when it's full) and when your calculation is finished.
Hope this helps
Blog[^]
|
|
|
|
|
Hello!
I have some problems with a Picture Control in MFC. I'm trying to fill it with a color selected in a CColorDialog. Do I have to create a monochrome CBimap object and then place it in the control? Is there a way to paint inside the picture control using maybe a device context? I'm using a CStatic class to interact with the control.
Thank You!
|
|
|
|
|
Check out the WM_CTLCOLOR notification message
« Superman »
|
|
|
|
|
Heh! This must be it. Thanks a lot!
|
|
|
|
|
All the text controls change their background color but not the picture control! Is there something special about it? I tryed to set the type Custom Draw but nothing works.... I'm sure that I must to do something special with it but I can't figure out what!
Thanks!
|
|
|
|
|
I have an RPC server which listens on TCP/IP endpoints for servicing client requests. It has been working fine all along, until today where on one of our client's PCs (running on W2K SP4), the server fails during its initialization.
On analysis of the error logs, I found that the when the RPC server registers its protocol sequence and end-points, it receives the error 1721 (not enough resources available for completion...). I don't understand what's causing this.
Any ideas
|
|
|
|
|
Make sure the dependencies your service has on other services are set up correctly. Maybe in this particular instance, your service is trying to start before another dependent service is running.
|
|
|
|
|
hi everyone,
my question is quite simple. i have both Visual Studio 6 and Visual Studio .NET 2003 installed on my computer.
i programmed a little tool in MFC with VC++6.
then, i'd like to burn it on a CD for someone who don't have VS installed. I must provide the MFC dll.
What DLL should i provide with my program ? MFC40.dll, MFC42.dl, MFC71.dll ???
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
i programmed a little tool in MFC with VC++6.
VC++ 6.0 Released Version Application Use MFC42.dll, so provide that only!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
oh oh, Mr alok is back !
ThatsAlok wrote:
VC++ 6.0 Released Version Application Use MFC42.dll, so provide that only!
yes, that's what i was thinking of, but i was not sure. do you have any rules to assure me on this ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
Mr alok
No need to Put Mr. by My Name , you can use Alok alone!
toxcct wrote:
but i was not sure. do you have any rules to assure me on this ?
Have a Try!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
ThatsAlok wrote:
Have a Try!
by burning 3 CD ?! lol
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
by burning 3 CD
Nope Just burning CD with MFC42.dll. I am Damm sure Visual Studio 6.0 Application Only use MFC42.dll!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Start your application with Depends.Exe.
This tool will show you which DLLs are used by your program.
It can be found in a sub directory of Visual.
cheers,
Marc Wohlers
|
|
|
|
|
HI Marc,
By Mistake you post your answer to Wrong Guy! ,
Right Guy, Who is looking for Answer is Tox.
Anyway 5x from Me
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
If you build your application in Release mode in VC++ 6.0
then i assure you don't need any dll files to attach to the CD.Your application will run on any other computer where Visual Studio is not installed without problems.
But if you do the same in VC++.Net 2003 then you'll need the
MFC71.dll file.
m0n0
|
|
|
|
|
quoting the MSDN (thanks to Alok) :
"Mfc42.dll needs to be redistributed with MFC applications unless you statically linked to the MFC DLL (that is, unless you specified Use MFC in a Static Library on the General tab in the Project Settings dialog box). Note that static linking to MFC is supported only in Visual C++ Professional and Enterprise Editions.
If you dynamically link your application to the MFC library, you will, at a minimum, need to redistribute Mfc42.dll and Msvcrt.dll. All MFC DLLs use the shared version of the C run-time library; thus, Msvcrt.dll is required.
"
so, revise your judgment...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Damn, you write faster than me
|
|
|
|
|
cedric moonen wrote:
Damn, you write faster than me
yep... you didn't know ?
:->
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
cedric moonen wrote:
Damn, you write faster than me
I will Ask TOX to use only one finger for typing and that too be Left hand Left Most Finger
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Revising my judgment...
Mfc42.dll is automatically installed in the windows directory if you install win98/XP that is why you don't need to attach this file to your CD. Because if the user has win98/XP installed it means he already has this dll file.
I've done it many times and have never experienced problems.
As mfc71.dll was released after win98/xp , thats why you'll have to attach this file to CD if you are building your app in C++.Net 2003
m0n0
|
|
|
|
|
i still don't agree.
if MFC is already install, it has 2 reasons for me :
1. Visual studio is installed on the computer
2. Another application already copied the libraries to the computer
if you format and install windows wathever version, try executing an MFC program without its dlls... it won't work !
and i trust MSDN on this point !!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
you can trust whom you want ...
I just told you my experience i ' ve copied my applications(simple exe-s,VC++ 6.0) to too many computers-s of my friends and not only who did not have Visual Studio installed and my app ran without any problems.
You can ask anybody that mfc42.dll is installed during the win98/xp install automatically.
Of course same did not work with app-s built on VC++.Net 2003
m0n0
|
|
|
|
|
toxcct wrote:
if MFC is already install, it has 2 reasons for me :
1. Visual studio is installed on the computer
2. Another application already copied the libraries to the computer
I agree. Point #2 is usually the reason that folks think MFC exists with native Windows.
toxcct wrote:
if you format and install windows wathever version, try executing an MFC program without its dlls... it won't work !
I agree again. This has happened to me on more than one occasion.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|