|
Christopher Duncan wrote:
so calling SetFocus to the password field in OnInitDialog() would be insufficient
Hmm.. I think the return value of OnInitDialog() affects which control gets focus. If you create an ordinary dialog and override OnInitDialog(), the following code is emitted in the function body:
return TRUE;
Have you tried returning FALSE?
--
Try walking in my shoes. You stumble in my footsteps.
|
|
|
|
|
Hey, Jörgen.
Jörgen Sigvardsson wrote:
Hmm.. I think the return value of OnInitDialog() affects which control gets focus.
Problem is, since this is a wizard, OnInitDialog does not get called every time the user navigates to this page. It's called only once, when the page is created. Typically, that's what OnSetActive is used for, but in this case even that doesn't work.
However, I think I'll try returning FALSE when I get to the office tomorrow just for the heck of it. Heaven knows I'm running out of ideas here, short of some really ugly hacks...
Thanks, man.
Christopher Duncan
Today's Corporate Battle Tactic
Unite the Tribes: Ending Turf Wars for Career and Business Success
The Career Programmer: Guerilla Tactics for an Imperfect World
|
|
|
|
|
Howbout just calling SetFocus() when and for the control you want the focus on?
|
|
|
|
|
Ernesto D. wrote:
Howbout just calling SetFocus() when and for the control you want the focus on?
Yep, that's what I have in mind. The tricky part is when and where. Typically, you'd do your initialization work in either OnInitDialog or OnSetActive, but focus is set to the first control in the tab order after both of these have returned.
Christopher Duncan
Today's Corporate Battle Tactic
Unite the Tribes: Ending Turf Wars for Career and Business Success
The Career Programmer: Guerilla Tactics for an Imperfect World
|
|
|
|
|
trying to create a CFrameWnd frame window as a child of a mainframe ( like other child frame windows and views )
m_pChildGridFrame->LoadFrame( ID_RESOURCE, WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, this );
The frame is created, but not at the same level as the other windows, I can't put my other views on top of that one.
I'm pretty sure the "parent window" is not the good one.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Won't you have to add the WS_CHILD style?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello, a while ago I planned on programming with c/c++. The problem was the compiler. Now I have one but when I make just a simple program like: "hello world" the DOS screen will apear for just very short. Then it closes itself. I was thinking maybe it was logical because you just tell him to show "hello world" and then it quits by itself. So I made a program were you had to put 2 numbers in variables. I entered 2 numbers and pressed ENTER and the same thing happens. Does anyone know how to solve this?
Thomas
|
|
|
|
|
Hello!
Try to use getch() or _getch() at the end of the code.
This application quits, becuase there is no loop. So either solution is to create a loop.
|
|
|
|
|
Try using getch() after your final input
|
|
|
|
|
it's not a problem...
If you run your application from VC with Ctrl+F5 you will see the message, and then you must to press a button to close it.
When you run your application for example in debug mode, the VC creates the console and close it when the app finish.
If you like, you can run your app from command line, and you will see when the app finish the cursor returns to the prompt...
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
I like to use this (at the very end of your program, before the return of the main function):
system("pause");
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
or you can add a cin>> at the end like I do
|
|
|
|
|
Is it possbile to add controls to a CDialog based class at runtime? It was easy enough in MC++ with the controls property of a form. Is there something similar for CDialog? Thanks.
- monrobot13
|
|
|
|
|
Hello!
Simply create required wnd class with parent set to the dialog and place it somewhere inside dialog (in order to see the control). See for example CEdit::Create(). Created window may have to be shown by CWnd::ShowWindow()
Tell me if you want more detailed description.
|
|
|
|
|
I sort of understand, but would appreciate a more detailed description, like how would I specify where in the dialog I want the control located (coordinates). Thanks again.
- monrobot13
|
|
|
|
|
// CtesttestDlg message handlers
CEdit *pEdit = NULL;
BOOL CtesttestDlg::OnInitDialog()
{
CDialog::OnInitDialog();
pEdit = new CEdit;
pEdit->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER, CRect(10, 10, 100, 100), this, 10005);
pEdit->ShowWindow(SW_SHOW);
...
and I know, I know...it should not be a global variable, and should be deleted somewhere, but this is only a sample :P
|
|
|
|
|
Makes sense, I'll give it a go. Thanks for the help.
- monrobot13
|
|
|
|
|
I've worked function pointers for years, mostly in C.
But I was wondering, since a reference is just a deference pointer, is there such a thing as funtion refernce in C++?
I do not remember reading about such a thing.
INTP
|
|
|
|
|
that's normal, functions references don't exist...
i'm sorry to announce to you that the function pointer is not dead !!!
remember that reference is not only a "dereferenced pointer"...
++ man
TOXCCT
|
|
|
|
|
toxcct wrote:
that's normal, functions references don't exist...
Ya, I did not think so.
toxcct wrote:
remember that reference is not only a "dereferenced pointer"...
Actualy they are, C++ just hides that fact (or has some thing changed?).
The first C++ complier was actualy a C complier with a C++ front end that converted the C++ code to C code before complation. Therefore, since C does not have direct references, all references where dereferenced pointers.;)
INTP
|
|
|
|
|
C++ defines references to functions, for instance:
typedef void (& fun_ref)(int);
...
void foo(int x)
{
...
}
...
fun_ref f=foo; Interestingly enough, there are no references to member functions. I don't know the exact reason, probably it is just an overlook.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you very much! That makes logical since to me. Of cource I was hopping that you could specify references to member funtions.
When I think of how references are normaly assigned (as you showed), I can see why there are no references to member functions.
INTP
|
|
|
|
|
When I think of how references are normaly assigned (as you showed), I can see why there are no references to member functions.
Really? I do not see any fundamental reason why references to member functions cannot exist, they'd be used like this:
struct A
{
void foo(int);
void bar(int);
};
typedef void (A::& mem_fun_ref)(int);
...
mem_fun_ref f=A::foo;
A a;
a.f(5); But anyway the sad reality is that references to member functions do not exist in C++. I've googled a bit for a plausible explanation, and found none
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Have you asked Stroustrup or the ISO C++ Committee about it?
How did they say?
Maxwell Chen
|
|
|
|
|
I want to prevent "Screen Capture".
I tried to prevent the message "Print screen" Key.
But "Capture Software" and Original Destktop Capture Software could capture.
So,I noticed mouse cursor wasn't captured.
I tried to draw object like drawing mouse-pointer.
But failed....I couldn't predict mouse-pointer drawing process.
Do you think of the solution method ?
"mouse-pointer drawing process"
or other method ?
|
|
|
|