|
The setup wizard program scans for SQL servers, and programs the initial credentials into the new SQL server, and then creates the first database. Then it goes out and write the settings to an INI file in the web application. So there's a lot of combo and text boxes throughout the 5 stages. It's a windows program that runs after the initial program setup via Installshield. It's about 5 screens till you print out the results.
I'll give the dialog a try first and see how it goes.
Thank you.
|
|
|
|
|
jkirkerx wrote: The question is, would that extra window be considered an MDI child window, or just a regular window.
it would be considered extra window, for creating MDI application in the win32 you have to create MDI container and then create window into it. it's quite different the way MDI application is created in VB. if you have liberty of using MFC, VS provide wizard to create skeleton MDI application.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
The following code puts my compiler into never never land.
CString text = "?";
SetDlgItemText(IDC_EDIT1,text);
Whan needs to be done to accomplish this?
I can type as many ? into the box as I desire, but I cannot set any text which has ? in it. Also getting "Invalid cursor error", but not sure from where.
Any constructive help will be as always appreciated.
Vaclav
|
|
|
|
|
Are you saying it gives a compile error, or a runtime error?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Run time problem, the program does not respond when I set a break point at the SetDlgItemText(IDC_EDIT1,text);
I guess the real question is - can ? be considered an alpha character?
Sorry - my mistake - I cannot test it this way. It sets the OnChangeEdit1() and comes right back to my test - that is way the program does not respond because it is in the loop.
I''ll put some flag before the test so it does not get into loop.
But I thing it should accept ? without any problems.
The Invalid cursor error must be coming from somewhere else.
|
|
|
|
|
If the breakpoint doesn't work, that implies that the source and the executable don't match. Try a Clean and a complete Rebuild.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Found it - putting the ? within the text my SQL which goes thru each character and then "translates" it into a string ( Morse code) did not have ? in the data.
So as I originally suspected- the error message was coming from SQL.
Little cryptic, but nevertheless a valid error.
|
|
|
|
|
Glad you figured it out.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
There is nothing special about ? nor any printable character in a text box.
If, as you imply, that you are setting IDC_EDIT1 during the OnChangeEdit1() callback, that is a loop. Code changing the window content or user entering data both trigger the OnChange type events. Happens with all the major controls, pulldown menus, tree controls, etc. In those, changing the selection is the same as the user clicking on them.
because it's looping, it never gets around to drawing the contents on the screen.
|
|
|
|
|
Hi, I have a modeless dialog with a edit control, and two button.
I show the dialog maximized, I got maximized the edit control with
void CEjemplo::OnSize(UINT nType, int cx, int cy)
{
CDialogEx::OnSize(nType, cx, cy);
if (GetDlgItem(IDC_EDIT1))
{
GetDlgItem(IDC_EDIT1)->MoveWindow(5,5,cx-1,cy-1);
}
}
But I dont know how to move the button at the botton of the dialog.
Now, when I maximized the dialog the button dont move itself and it is at back of edit control
I tried to do
if (GetDlgItem(IDC_EDIT1))
{
GetDlgItem(IDC_EDIT1)->MoveWindow(5,5,cx-1,cy-1);
GetDlgItem(IDC_button1)->MoveWindow(5,5,cx-1,cy-1);
}
But not run.
|
|
|
|
|
antonio343 wrote: But not run
Crash or not moving the controls in the good position ?
When doing something like that, moving controls around, I play dumb and use the dialog client area rectangle (GetClientRect ).
Play around with the values to move to the bottom of the rect returned by GetClientRect;
Note: be careful with the coordinate being in either relative to the client or window .
Watched code never compiles.
|
|
|
|
|
Not moving the controls in the good position.
I dont know how to use this function.
Maybe on this way:
void CEjemplo::OnSize(UINT nType, int cx, int cy)
{
CDialogEx::OnSize(nType, cx, cy);
CRect myRect;
GetClientRect(&myRect);
if (GetDlgItem(IDC_EDIT1))
{
m_Edit.MoveWindow(5,5,cx-55,cy-55);
m_Button1.MoveWindow(myRect.right, myRect.bottom,
myRect.Width(), myRect.Height());
}
}
But I dont want to change the size, only the position. I'd like to move at the right botton corner.
|
|
|
|
|
use SetWindowPos (with the SWP_NOSIZE option, check the documentation ) function instead of MoveWindow.
M.
Watched code never compiles.
|
|
|
|
|
I've tried with this:
void CEjemplo::OnSize(UINT nType, int cx, int cy)
{
CDialogEx::OnSize(nType, cx, cy);
CRect myRect;
const CWnd &p=wndBottom;
GetClientRect(&myRect);
if (GetDlgItem(IDC_EDIT1))
{
GetDlgItem(IDC_EDIT1)->MoveWindow(5,5,cx-50,cy-80);
m_Button1.SetWindowPos(&p,5,5,cx-50,cy-75,SWP_NOSIZE);
}
}
But when I run the application it crash
|
|
|
|
|
antonio343 wrote: But when I run the application it crash
Exception thrown? Assertion fired? Have you stepped into the code to see what is actually going on?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I'm sorry , the error wasn't due to the setwindowspos. I solved the error.
It run well, but I need know the coordinates of the right bottom corner.
|
|
|
|
|
antonio343 wrote: It run well, but I need know the coordinates of the right bottom corner.
Relative to what?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
antonio343 wrote:
m_Button1.SetWindowPos(&p,5,5,cx-50,cy-75,SWP_NOSIZE) change this to read:
m_Button1.SetWindowPos(&wndTop, cx - m_Button1.Width - 5, cy - m_Button1.Height - 5, 0, 0, SWP_NOSIZE);
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
I cant change this, becouse CButton don't have some member "width" and "Height"
|
|
|
|
|
A CButton is a Window, WIndows have Rect (GetWindowRect() function). Rect gives you height and width. So it's not a straightforward as posted but easily obtainable.
|
|
|
|
|
Sorry, the other poster is right. Use
CRect rect;
m_Button1.GetWindowRect(&rect)
rect.Width()
rect.Height()
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Assuming the coordinate system is correct (Client View, Control View, Screen View), which is a big assumption at this point, the line
m_Button1.MoveWindow(myRect.right, myRect.bottom, seems to want to put the left edge of the button at the right edge of the main window, therefore, it's not visible since it's off the right side of the main window. Similarly for the y coordinate, you're putting the top of the button starting at the bottom of the window, therefore it's outside the viewing area
|
|
|
|
|
antonio343 wrote: Now, when I maximized the dialog the button dont move itself...
See if the Extras section of this article is of any help. I've updated the code in a newer project but the premise is the same.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
+5. Good bit of code.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|