|
Hi,
anybody know, how can I add my own dialog box to system informations (right click on file in explorer) about file? Can anybody tell me how or where are the informations about this??
thanks
defox
|
|
|
|
|
I;m trying to add functionality to my app that will allow users to draw a box around a group of items in the view to select. This would function much like in power point and the like where you can select a group of items. It would even function like the dialog creation/editing part of VC++. Anyway, I'm trying to use DrawDragRect but am getting some unwanted results what with the default brush and all.
Does anyone have any ideas on how to make this work? The code that I'm using in my OnMouseMove is:
aDC.SetROP2(R2_NOT);
CRect lpRect = CRect(m_FirstPoint, point);
aDC.DrawDragRect(lpRect, CSize(1, 1), m_RedrawRectLast, CSize(1, 1), NULL, NULL);
m_RedrawRectLast = lpRect;
|
|
|
|
|
Please bear with me, this is a lot to explain...
I have a C++ dll that I wrote to call Crystal Reports API functions. It basically just modifies query statements and exports to different formats or prints to a printer. When compiled with debug settings, using MFC statically linked, it works fine on Win2k Server. When compiled as a final release, using MFC as a shared library, it works fine, with one exception: when the report needs to create multiple html pages during the export process, I get a very general Crystal Reports error (Operation not yet implemented). Sounds like a Crystal Reports problem, I know. But there's more---
After much testing, I realized that if the correct number of files (or more) already exist, this error does not occur using the MFC shared dll. It seems to just overwrite the existing files, but it will not create them. The statically linked dll, however, will create the files. Sounds more like an MFC problem, now.
I'm compiling on a WinXP Pro PC, using VC++ 6.0 SP5. I've also tried compiling release version with MFC statically linked, but of course the linker ignores references to kernel32.dll, so it's not the same and the error still occurs. Incidentally, my PC at home, running software identical to the Win2k server except for the OS (it's XP), runs this dll just fine compiled either way. So I had a co-worker compile it on Win98, thinking maybe it had something to do with XP, and the exact same behavior occurred. I guess I'll try Win2k next...
Anyway, any insight into this problem would be greatly appreciated, as this is driving me nuts. I'm fairly experienced with C++, but I don't know much about MFC. It would be nice to have this dll around the 36K size that it should be, though, rather than the 1.33MB that it is right now.
~DW
|
|
|
|
|
I *always* statically link MFC - because you can't be sure what version of MFC42.DLL the user has on their system, so you may have to install a new one. And I hate having to install over system DLL's.
But I have read that there is a macro, called AFX_MANAGE_STATE, that you need to call for any expoted function. It goes something like this:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
According to this MFC book (Inside Visual C++), this macro exists because there are some global variables that need to be synchronised correctly in these scenarios.
Even if you win the rat race, you're still a rat.
|
|
|
|
|
>>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
|
|
|
|