|
One solution is to override OnInitDialog() and call SetFocus() on the editbox inside it.
Kuphryn
|
|
|
|
|
Does it mean to override the OnInitDialog of the child C123?
If yes,
I wrote:
BOOL C123::OnInitDialog()
{ m_CName.SetFocus();
CDialog::OnInitDialog();
return TRUE;
}
but there is no change.
??
|
|
|
|
|
Post a message vis PostMessage(). Post WM_SETFOCUS.
Kuphryn
|
|
|
|
|
I have used :
m_CName.PostMessage(WM_SETFOCUS);
// and delete the CDialog::OnInitDialog in C123::OnInitDialog but still not work
|
|
|
|
|
You can't call SetFocus() until the dialog is created. The way you have it now, you're calling a method of m_CName before the control exists. THe proper way to set focus to a control is in OnInitDialog() and return FALSE from OnInitDialog()
--Mike--
Latest blog entry: *drool* (Alyson) [May 10]
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
I stand to be corrected but in OnInitdialog looks good to me but should you not
return FALSE when specificaly setting the focus. You are returning TRUE which
If my memory serves me correctly is wrong.
The default implimentation adds a comment stating this.
Hope it was of some help
cheers
|
|
|
|
|
Sorry,
I see "Michael Dunn" has already said this, I did not see his response at the time.
cheers
|
|
|
|
|
I got it
Thx all.
|
|
|
|
|
Say that you have created a new dialog based project, and included some OCX as an object in that dialog.
Is there any way to override the OCX's OnPaint()?
Thanks,
David
|
|
|
|
|
VC++ .NET 2003 supports the typename keyword. However, by all appearances this keyword is superfluous. The compiler "knows" whether a reference object is a type (else my code in question wouldn't have compiled with the previous compiler.)
So can anyone, in plain english explain why typename really is needed (aside from making the compiler ISO compatible)?
|
|
|
|
|
Supposedly, it helps the compiler spot errors before instantiation time. Follow this link[^] for a particularly pathological example (I guess all examples with regard to this subject are pathological anyway).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Now I have been assigned a task to do a FDD test. During the project I don't know how to make the Floppy-Disk-Device's LED blinking. Could you tell me some solutions to it, please.
Thank you!
LeonOrient
|
|
|
|
|
I don't think you can make that LED just blink. I don't see a reason why that LED would be accessed through software. Just try to open a file that doesn't exist in the floppy drive and make sure that you don't have any floppy disks in it and that way you might make it blink.
CFile aFile;
aFile.Open( "a:\\NoName.txt", CFile::modeRead );
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Alough there is a bug, the solution is still a good way.
Thanks!
Can we make Floppy-Disk-Dervice' LED to blink by
adopting the "DeviceIoControl"? This is just my thought.
Who can tell me a better way and its realization?
3Ks!
LeonOrient
|
|
|
|
|
I can use this command line "exefilename.exe -? >>a.txt" in Windows command prompt to store the parameter information into a.txt. But when I use WinExec to execute this command in my program, it doesn't work. neither does ShellExecute.
The only thing it does is displaying the parameter info in the command prompt terminal (I can see the prompt flashing).
Thank you to help me!
|
|
|
|
|
Well, the program itself isn't the one doing the redirecting, it's the "cmd" (NT bases systems) or "command" (95 bases boxes) program that does the redirecting. So, if you want to do it, you can do it like this:
TCHAR a_szCommandLine[512] = {0};
_stprintf( a_szCommandLine, _T("cmd.exe /c \"exefilename.exe -? > a.txt\"") );
WinExec( a_szCommandLine, SW_HIDE );
Chris Richardson Terrain Software
|
|
|
|
|
|
I am building an sdi app with a static splitter. I want to add a command so that when the user selects it from the menu, some controls are enabled in one of the views.
To accomplish this I manually added member variables to refer to the controls in the view class for one of the split windows. However, if I add a member variable using the GUI of vs.net, I can only add it to the original view class (that mfc appwizard created). How can I get the GUI to add them to my new view classes?
Thanks!
|
|
|
|
|
Don't - why would you want to ? Open the file and add them manually, as you say you have done.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Well, i have no use for the original view class anymore... though I don't really understand what happens to it when one uses a static splitter (sometimes when I resize the window and it flickers, it seems like the old view is still under there?). I am just curious how the GUI decides where to put the member variable, if it determines it from the code or if it is just some obscure setting somewhere that it set when the appwizard generates the project.
|
|
|
|
|
I really need example code to help me with accessing a control that is in a dialog bar from the main window. I have not found any examples or tutorials on the internet.
-- Steve
|
|
|
|
|
How can I get the my program "Tray Icon position" in Desktop window without any clicking message from icon?
|
|
|
|
|
|
Does anyone out there have any information about how to mix a MFC EXE that uses CString with a DLL that uses ATL CString?
They are related but won't link together as-is.
Any clues or news out there?
P.S. I am not looking for alternatives to CString, but am looking for information about how to make these slightly different CString's talk to each other.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
Santa Cruz Networks
|
|
|
|
|
For completeness, I'll share what I've learned.
Though first, I'll say, that everytime I think MS is getting their act together, you run into to something totally weird...
If your MFC program wants to call a DLL that uses CString in it's API's -- they will only work if the DLL is MFC too. ATL CString will screw it up with name clashes....
I fixed my problems by using AtlCString -- which the ATL CString is a typedef of.
there's no documentation for this at all.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
Santa Cruz Networks
|
|
|
|