|
CreepingFeature wrote:
Got four replies, none of which worked!
Were any of them FillConsoleOutputAttribute() and FillConsoleOutputCharacter() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I think I replied to your question or was it someone else's?? dunno well you should use
system("cls");
it's fast, easy and painless.
|
|
|
|
|
namethatnooneelsetook2 wrote:
it's fast, easy and painless.
It's also antiquated, inefficient, and reminiscent of Unix days. The system() function starts a complete command interpreter, which then executes the <insert command="" here=""> command. I cringe when I see solutions that have employed the system() function. There is virtually nothing it can do that can't be done better by a direct API call. I consider it to have died with Win16 and is kept on for backward compatibility with old 16-bit programs that are being converted.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Those are what is used in Q99261.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
I see that. What's your point?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Try this
void ClearScreen()
{
HANDLE hSTDOut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwCoord;
DWORD nLength;
DWORD lpResult;
CONSOLE_SCREEN_BUFFER_INFO Info;
dwCoord.X = 0;
dwCoord.Y = 0;
// Get the console buffer info
GetConsoleScreenBufferInfo( hSTDOut, &Info );
nLength = Info.dwSize.X * Info.dwSize.Y;
// Fill the console with ' ' making it look like it has been cleared
FillConsoleOutputCharacter( hSTDOut, ' ', nLength, dwCoord, &lpResult );
// Set the console cursor position to 0,0
SetConsoleCursorPosition( hSTDOut, dwCoord );
}
|
|
|
|
|
Whilst using VC6 just now and somehow acceidentally press the certain key combination which means all tabs are now marked ">>" and all spaces ".". anyone know how I can turn this off please? Ta.
I feel like I'm diagonally parked in a parallel universe
Jerry Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Jeremy Davis wrote:
anyone know how I can turn this off please?
Yes, just use Ctrl+Shift+8.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
I know this is another silly question, but what's the best way to return IDOK from my dialog without the user pressing a button? This is not meant to be a security loging I have, but just a login for record purposes. I store the last login in the registry, and when the login pops up, I populate it with the last login in the edit box. If that login is valid I just want to return IDOK without the user ever seeing the login dialog. How should I go about doing this?
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
what's the best way to return IDOK from my dialog without the user pressing a button?
How about just calling the base class OnOK() ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Sorry for being so idiotic again. But I thank you once again. I also do VB and in the past few weeks I've been forced to learn Visual Foxpro and am now one of a two-man team that neither one of us really knows anything about vfp but were tossed into a large-scale project, so I think that has helped muddle my thinking some, also. I hope that sounds like a plausible excuse. Thanks
[insert witty comment here]
bdiamond
|
|
|
|
|
bdiamond wrote:
I store the last login in the registry, and when the login pops up,
Probably best to not popup the login dialog if the access information in the registry is valid. Of course, this will prevent the user from ever logging in as someone else (if this functionality is desired).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I want it to still check just in case the user has been taken out of the system, login changed, etc. But if it has a valid login, which the string is sent to the dialog's constructor that was found in the registry, it calls the validate function and if it's valid, it will call the base class's OnOk() member. (Well, that's the way I'm hoping it works)
[insert witty comment here]
bdiamond
|
|
|
|
|
|
I think that's the specific function I was looking for, although CDialog::OnOK works fine also
[insert witty comment here]
bdiamond
|
|
|
|
|
i want to define a type like this:
<br />
struct PolyLine<br />
{<br />
double box[4];<br />
int nParts;<br />
int nPoints;<br />
int parts[nParts];<br />
Point points[nPoints];<br />
}<br />
but this obviously doesnt work because the array lengths at the end are variables. can anyone suggest a way around this?
|
|
|
|
|
Either allocate the arrays and store the pointers in the structs (but you have to also remember to deallocate the arrays) or use std::vector.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
the thing is, i want to read in a .shp file which has a number of records all structured in that way. so if i could read them into a buffer which is an array of the structs defined before, then the whole file could be read with one call to CFile's Read member. if the array parts of the struct were just pointers, would this still work?
thanks for your help.
|
|
|
|
|
Hi!
I have dialog based application with one modal dialog. The modal dialog should take some data from dialog based application and display it on the screen in the Edit Box. How to do it?
Thanks!
|
|
|
|
|
It sounds like there are two programs involved here. Is that correct? If so, you'll need to use some form of IPC such as DDE, clipboard, RPC, or the WM_COPYDATA message.
Johnny Peszek wrote:
...and display it on the screen in the Edit Box.
Use CWnd::SetWindowText() , or send the edit control a WM_SETTEXT message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
no, I think he want to have the parent's dialog application data display in a modal dialog of that dialog application
anyway, You can either passer the data in the modal dialog constructor ( override the current constructor ) or pass the parent pointer to the modal dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
As a matter of fact there is only one program (dialog based) and it processes data. And there is also a modal dialog as an inserted dialog resource.
Regards.
|
|
|
|
|
That's simple enough then. Change the constructor of the second dialog to also accept a pointer to the first dialog (the parent). Then the second dialog will have access to properties/methods of the first dialog. Something like:
class CDialog2 : public CDialog
{
public:
CDialog2( CDialog1 *pDlg, CWnd *pParent = NULL);
private:
CDialog1 *m_pDlg;
}
CDialog2::CDialog2( CDialog1 *pDlg, CWnd *pParent )
: CDialog(CDialog2::IDD, pParent)
{
m_pDlg = pDlg;
}
...
CDialog2 dlg(this);
dlg.DoModal();
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
It looks fine. I have done everything as you wrote but there is 1 error:
“error C2512: 'CDialog2' : no appropriate default constructor available”.
The error occurs in the method of the CDialog1 in line with CDialog2 dlg;
What should I do?
Regards.
|
|
|
|