|
>>Even if you win the rat race, you're still a rat.
And whats your point?
Thats a good one......
|
|
|
|
|
SO far whenevr I created a member variable associated with an editBox I've made it of type CEdit (control not CString), but the Class wizard also offers the choice of CString. I didnt think much about it. But in a sample I am following, I see that a CString variable m_editString has been created for an IDC_EDIT1, and by magic the text put into m_EditString, populates the editbox! I was expecting to see the usual member of type CEdit and stuff like:
myCedit.SetWindowText(someCString).
I've hunted high and low in the sparse sample code and dont see anyplace where the string is being assigned to the editbox. SO is this something internal that happens if you create a CString variable instead of a CEdit variable and associate it with a CEdit?
Basically I wasnt curious about what the option - Control or Value was present for. Please clarify if my deductions are correct? I am probably totally off the mark, but I really do not see anyplace where a string is being setwindowtexted. Hope my question is clear.
Thanks,
ns
|
|
|
|
|
It is handled in your dialog's DoDataExchange function. You will find a wizard generated call to DDX_Text() that assigns the string to the editbox. Alternatively, if you specify a max string length when you are in Class wizard, you will find a DDV_MaxChars() call associated with the same edit control
HTH
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I prefer to manually get/set CStrings from edit controls because it allows me full control over validating the user's input. I set controls in the dialog's OnInitDialog() handler, and get the controls' values in OnOK() .
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
well, personally, I prefer CString, if you just want to deal with its text display and retrieving. As the above post mentioned, this is done by MFC via data exchange and data validation.
use UpdateData(TRUE) to get user input for this CString variable, while UpdateData(TRUE) in place for SetWindowText.
|
|
|
|
|
Definitely something new I learned today! I'd never even pondered why there were two choices - Value or Control when setting a variable for CEdit!!
Appreciate the responses,
ns;P
|
|
|
|
|
Hi All,
I've got an existing app (MFC MDI app) that does some neat calculations. I have been running this app manually, but now I need to be able to "talk" to the app from another application. I'm thinking COM interface, but not sure exactly how this works. The other app needs to be able to control the MDI app, change data structures, stuff like that. I tried to make a new MFC project with "Automation" checked, and got another MFC app whose document sported a disp interface, but wasn't too sure what to do with that.
So, here's my question. Assuming I've imlpemented an MFC app with automation support, and added some methods I would like to call, how can I A) Fire off this app from an existing ATL COM object (In proc) B) Invoke methods on the document and C) prevent the user from interacting with the app.
Thanks in advance,
Aaron
|
|
|
|
|
No, this is not a question about cars
I would like to add functionality to my MFC dialog so that the user can click a button to make the window "rollup". Similar to the middle top-right button in Winamp.
Anyone have any ideas on this?
I'd prefer it if I could make the design similar to Winamp in that a "new" dialog is shown as the "rolled up" window, but if this is not possible, then just showing the title bar is acceptable (I suppose). I assume doing it this second way would just be resizing dialog to something slightly bigger than the titlebar, now that I think about it.
TIA.
|
|
|
|
|
Having never seen Winamp, I am not sure what you want, but is this <clickety> what you are looking for?
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
That's *sort of* what I mean, but I'm looking to rollup the whole app (so it's just like the Minimize or Close system buttons), instead of a just child window of a larger app.
PJ Arends wrote:
Having never seen Winamp
What do you use for mp3s then?? please don't say WMP7.
|
|
|
|
|
mp3s
I actually prefer talk radio. This <clickety> radio station is left on 24/7 in my house.;)
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
From BC I take it? I call Victoria home, but right now I'm in a little town called Kitchener/Waterloo for a few more (hellish) years.
|
|
|
|
|
Atlantys wrote:
From BC I take it?
Abbotsford.
Atlantys wrote:
I call Victoria home, but right now I'm in a little town called Kitchener/Waterloo for a few more (hellish) years.
Oh man you gotta come back to lotusland, the weather is great
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
I would think it could work if you used a dialog template for the minimized window, just remove the title bar. When your app is "minimized", just destroy your main window, and recreate your main window using your minimized dialog. Of course this would be a lot easier to implement if your main window is also a dialog;P.
If you want the window to visible shrink, you would have to use a timer and SetWindowPos().
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
It can't be that hard. Why not use SetWindowPos( ) keeping the left and top coordinates the same and resize the height and/or width of the window?
|
|
|
|
|
BTW, I recently D/L'd Paint Shop Pro 7.0 and all of it's floating toolbar windows are rolled up that way but when you put the mouse over the caption or title, it restores itself to it's previous size. Cool!
|
|
|
|
|
That's what I was initially thinking, but that doesn't allow me to make the "rolled up" window have a different template. It'll just make the current window smaller, eh?
If you'll notice what they do in Winamp (sorry, only program I know that has this feature), when it is rolled up, the title bar changes and buttons are added. Which is what i'm going for.
The idea behind this is: the user can make the window as small as necessary without sacrificing the ability to use the more important functions (and Minimize makes the window disappear completely).
|
|
|
|
|
Yes, it will make it smaller but you can shrink it down to the title bar size only which is what you want, right? I think you need to set CS_OWNERDRAW and draw the title bar yourself if you want buttons. Search this site and others for examples.
|
|
|
|
|
Check this out:
http://codeguru.earthweb.com/buttonctrl/ccaptionbutton.html
http://codeguru.earthweb.com/dialog/custom_dialog_caption.shtml
and...
http://codeguru.earthweb.com/misc/wm_nclbuttonup.html
Good luck!
|
|
|
|
|
In winamp when the title bar is changing it is pulling bitmaps from either the default skin or from zip files containing the other skins (if you rename a skin file to .zip it will be unzippable). Same goes for the buttons and the rest of the graphics in winamp. I'm not sure what is done programatically to get them to draw over, but a few of the things mentioned looked like it could work.
I had a little fun doing a skin for winamp once so I learned about how they change the image. I hope that helps some.
Quinn
|
|
|
|
|
How can we read & write File Title.
This File Title is the one visible by Right Clicking the File Properties on the Windows Explorer & hitting the Summary Tab.
Thanks
Ganesh Agrawal
|
|
|
|
|
This info is usually only available for Microsoft Office documents (Word, Excel, PowerPoint). MSDN article HOWTO: Read Compound Document Properties Directly with VC++ provides a full working sample showing how to retrieve the information.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
what is the best (and simpliest) way to communicate between processes ? One process is typical MFC application, the second is console service. So how can these two applications communicate ? It must run under W95/98/NT/2k/XP.
Thanks in advance. Standa.
Celebrate Mr. Cesilko!
|
|
|
|
|
|
How I could implements fast playing of wave file (for example 2x faster) by using waveOutXXX functions?
|
|
|
|