|
The only way of stopping the display is simply not to display anything in your code.
You'll have to manage it yourself: in your code, wait for the user to press a key before going to the next step.
|
|
|
|
|
In addition to Cedric Moonen said...
You can use GetConsoleScreenBufferInfo for getting the screen size.
|
|
|
|
|
Can't you just scroll the console window up (with the mouse) to see the older text?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Everybody...
I have a query on SDI implementation. How can I make a SDI Document not to be dragged.
Thanks in advance
Sairam
|
|
|
|
|
What do you mean ? Could you be more precise please ?
|
|
|
|
|
We can move the window with mouse clicking on Tittle bar. I want to restrict this..
Thanks & Regards
Sairam
|
|
|
|
|
1/ There may be good reasons for resticting the size of an application. But the position? I officially don't want to use it.
2/ Have a look at WM_WINDOWPOSCHANGING to reset window movement, or override WM_NCHITTEST to tell windows this is not a draggable window bit.
3/ See (1) again. You'd better have a VERY good reason to do this, or you'll get hate vibes from customers.
Iain.
|
|
|
|
|
Hi all,
What I know about CFile::GetFileTitle(); that it gives the title(name without the extension) of a CFile. So what is happened here in this code. I found this on MSDN.
Try
{
CFile sysFile(_T("\\My Documents\\FOO.DAT"), CFile::modeRead);
_tprintf(_T("Path is : \"%s\"\n"), (LPCTSTR) sysFile.GetFilePath());
_tprintf(_T("Name is : \"%s\"\n"), (LPCTSTR) sysFile.GetFileName());
_tprintf(_T("Title is: \"%s\"\n"), (LPCTSTR) sysFile.GetFileTitle());
sysFile.Close();
}
CATCH(CFileException* pEx)
{
pEx->ReportError();
}
Output
Path is : "\My Documents\FOO.DAT"
Name is : "FOO.DAT"
Title is: "FOO.DAT"
Here output for Title is FOO.DAT, is it correct.
Here is the link I get it on MSDN Library 2004.
ms-help://MS.MSDNQTR.2004JUL.1033/dv_wcemfc4/html/aflrfcfilecolcolgetfilename.htm
I appreciate your help all the time...
Eranga
|
|
|
|
|
Have you looked at MSDN to find out what it says GetFileName and GetFileTitle actually DO?
Then you'll be able to answer the question yourself.
Iain.
|
|
|
|
|
Eranga Thennakoon wrote: Here output for Title is FOO.DAT, is it correct.
That depends on how you've got Windows configured to show file extensions. The GetFileTitle() method is simply respecting that setting. If you don't want the extension displayed, regardless of Windows' setting, you'll have to remove it yourself.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for replay. I'll go through the MSDN and still have some questions. I'll be here if I couldn't clear it up.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Dear all
the following is my part code, when i run, d[m] is minimum value of an double array named c of 150x3. actually total of num1, num2 and num3 are 150..but here why num1 = 150, num2 =151,num3=151...
for (int m = 0; m < 150; m++)
{
if ( d[m] == c[m][0])
sum1 = c[m][0];
sum1 = sum1 + 1;
num1 = num1 + 1;
if ( d[m] == c[m][1])
sum2 = c[m][1];
sum2 = sum1 + 1;
num2 = num1 + 1;
if (d[m] == c[m][2])
sum3 = c[m][2];
sum3 = sum1 + 1;
num3 = num1 + 1;
}
cout<< " "<< num1 << " " << num2 << " " << num3 << endl;
cout << " " << sum1 << " " << sum2 << " " << sum3 << endl;
but the result is following:
num1 num2 num3
150 151 151
sum1 sum2 sum3
1.87 2.89 2.89
Li Zhiyuan
5/10/2006
|
|
|
|
|
This looks wrong:
li zhiyuan wrote: sum2 = sum1 + 1;
num2 = num1 + 1;
sum3 = sum1 + 1;
num3 = num1 + 1;
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
thanks, so sorry...i corrected already, but the problem is : num1 = num2=num3 =150....actually total of num1, num2 and num3 are 150..thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
::hint::
So when you used the debugger to step through this code snippet, ...
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm using Visual C++ 6.0, and am getting an "Out of Memory" error while trying to run in both debug mode and in release mode. Running the release standalone EXE works fine, aside from the bug I'm trying to fix. I've got alot of arrays declared and vectors reserving space. What I'm not understanding is why will it not run in the IDE, but run fine outside of it? I know I can probably try to decrease the size of the arrays and vectors, to see if that can fix the error. But it was running fine a while ago, I changed something unrelated to the array sizes, and then started getting this error. Any help on tracking this down and fixing it so I can run in the IDE would be greatly appreciated.
A soft glow comes from the pit in the darkness.
The clicking noise become faster - and louder.
A wind begins to stir up from the pit, as the
creature flexes it's wings, preparing for flight.
You stare into the pit, and hear a voice say
in your mind, "If you survive the encounter,
declare it to the world."
The Code Demon Rises.
|
|
|
|
|
Can anyone help me on a try catch block? Not quite sure on the catch block. I want it to display a message box if the error the path in the try block does not exist.
<br />
<br />
try<br />
{<br />
System::Diagnostics::Process::Start("C:\\client\\debug\\client.exe");<br />
}<br />
<br />
catch(char *ex)<br />
{<br />
MessageBox::Show ("Not able to connect to PANGU server!", "PANGU Server Error!");<br />
}<br />
<br />
finally<br />
{<br />
}<br />
|
|
|
|
|
Take a look at what exceptions the System::Diagnostics::Process::Start()
method can throw.
Ripped right from the docs...
try
{
System::Diagnostics::Process::Start("C:\\client\\debug\\client.exe");
}
catch ( System::ComponentModel::Win32Exception^ w )
{
Console::WriteLine( w->Message );
Console::WriteLine( w->ErrorCode );
Console::WriteLine( w->NativeErrorCode );
Console::WriteLine( w->StackTrace );
Console::WriteLine( w->Source );
Exception^ e = w->GetBaseException();
Console::WriteLine( e->Message );
}
On my test, w->Message == "The system cannot find the file specified".
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you for your reply, that fixed my problem
|
|
|
|
|
|
hello,
A friend of mine has an exam tomorow in c++, here's the problem:
1. Read two integers inputted by keyboard
2. Find all the separate numbers from the first integer (if integer is abc split it into a-b-c)
3. Do the same for the second integer
4. Compare every number from the first array with every number from the second array.
now, he doesn't know how to split the integers into separate numbers...
I'm TOTALY new to c++ so I came here for an answer to help him..
thanks
|
|
|
|
|
VIP-CoMmAnDo wrote: he doesn't know how to split the integers into separate numbers...
Maybe some clues...
If the integers are entered as ASCII, then each ASCII
character in the array is a number.
Given the specs, there's no need to convert them to binary integers,
but if he must, '0' can be subtracted from each ASCII character to
get the binary number.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Unfortunately, the friend of mine able to help on such questions will be away 'till next week.
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.
[my articles]
|
|
|
|
|
Nicely put! I now do a small bow in your general direction.
Iain.
|
|
|
|
|
So what are these kids expected to do in the meantime, figure it our for themselves? How lame is that? This poor kid might not graduate because he failed to turn in an assignment. Wouldn't it just make you feel awful to know that you could've helped but didn't?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|