|
Yes, it's my last choice.
Because I change the size of the image when the client's size chnages,
I'l like to have less coupling.
|
|
|
|
|
followait wrote: I'l like to have less coupling.
hmm I'm not sure what you mean....if the size changes then
you need a new bitmap as well, right? Your Graphics object, which is essentially
a memory DC, is tightly coupled with its "selected" Bitmap.
Maybe Graphics::GetVisibleClipBounds(...) gives you what you need?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In my application i have created a new dialog box which has 4 check boxes and 4 static boxes. when the check box is checked the data will be logged into a folder. when its not its says not logged. now i am using GetDlgItem to display whether is logged or not logged using a static control. i m not getting the output properly. what is happening is when i click on the check box the static box displays the correct result and vice versa. but when i click OK button and again open it, if the check box is not checked it would say logged. what can be the reason for that? is the value getting killed once i close the window? if yes then what needs to be done to make it stay on the dialog
|
|
|
|
|
If you are destroying a window, the state of controls will be lost or reset. You have to set the states of controls at startup of the window.
What kind of window is that? How do you show that? Is it a dialog? If so is it an MFC dialog?
|
|
|
|
|
correct. its resetting or lost. i have inserted a dialog using the resource. how do i set the state at startup. how do i hold the previous value when i again open the dialog? its an MFC dialog. i have a button in the tool bar. when i click this button the dialog opens up,
|
|
|
|
|
Are you keeping the dialog object permanant (as member)? Or just using in function scope of toolbar button click?
|
|
|
|
|
i am keeping the dialog object permanantly.
modified on Thursday, January 17, 2008 3:12:40 AM
|
|
|
|
|
If so you just create control variable (of value type) of the check box. MFC framework will store and load the check box status for you.
|
|
|
|
|
First of all let state that I come from a MainFrame Background as that reflects my understandings windows apps
While reading a Windows Internals Book I have seen the Term Address space refered to as in "The application Address Space"
My question when DLLis loaded either Staticlly by refering to an exported function or Dynamically via a LoadLibrary
IS that DLL too in the Same Address Space of the app/exe (e.g using the same Data Segment Register hope that wasn't something stupid I said)
Or can DLL's be acessed by any application in Windows
Could there by two types of DLL's those running in the application address space and printer type DLL's which can be accessed by any Windows Application
Thankx
|
|
|
|
|
See if this helps.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Partly u r right. Dll will be mapped to the calling application's address space. When the other application loads the dll (either implicitly or explicitly), again the dll will be mapped to the corresponding process/application/exe. It means dll can be accessed by 'n' number of processes at the same time.
Come online at:-
jubinc@skype
|
|
|
|
|
I have a dialog box with an Edit control. Can I forbid the Paste action for that field?
In VC6++ pleasae ...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Just intercept the WM_PASTE message and don't pass it along to the default handler.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How? Can you give an example?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
The same way you would any other Windows (WM_xxx ) message. If you are using MFC, use ClassWizard (Ctrl+W) to provide a handler for that message.
Here is another resource:
http://www.mser.net/microsoft-developer-network/43/visual-c++-programming-430579.shtm[^]
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey,
how can I change (dynamic) the view from e.g. CView to CFormView? I know I have to do it in mainfrm but how?
|
|
|
|
|
|
|
Hey,
i've made some good controls and dialogs for me. From that time on, i'd copied all my files and resources to my new projects. Now I decided to make an DLL. So I started the project assistant and created a extended MFC-Dll and added my custem files and resources. So i build my DLL...
OK, but now (after linking to my new projects) I have probleme with my resources. Is there any to way to split resources or better use separate resources (one resource for application, one for dll).
Thank you for helping me....
|
|
|
|
|
AnTri wrote: I have probleme with my resources.
What problems?
AnTri wrote: Is there any to way to split resources or better use separate resources (one resource for application, one for dll).
The resources are separate for the DLL and the EXE. It's mostly a matter of
loading from the right module.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
When I link my (control) dll I'll get a lot of compiler-warnings: resource already defined, duplicated resource ...
e.g. in dll is a dialog with edit-control ID: IDC_EDIT1 = 1001
when I link the dll to my application e.g. Dialog with the same ID for edit-control I can't open the dialog! It seems that there is only one resource-list for the application an my dll!
|
|
|
|
|
MFC maintains a list of modules with resources, and loads them from wherever it can.
The simple solution is to make sure your resource IDs don;t overlap.
If you do a search for Anna Jane Metcalfe, she wrote an article with a utility to make reorganising resources much easier.
If you can't find it on CP, go look at her site: www.riverblade.co.uk, and prod around there. It wasn't hard to find.
Iain.
|
|
|
|
|
This should be a simple problem, but I am unable to solve it! My environment is VStudio 2005 and MFC.
The issue is printing text onto a DC. Should be simple enough, but here are some constraints:
1. The text may be rotated 0, 90, 180, 270 degrees.
2. The text may need reformatted within the bounding rectangle, meaning word-breaks.
3. The text will need to be aligned horizantally and vertically within the bounding rectangle - left, right, and center horizontally, top, center, bottom vertically.
Rotating text is not a problem.
Normally, I could use DrawText to print the text, but on rotated fonts, DrawText seems to choke. I tried TextOut and ExtTextOut. These rotate and position just fine, but can't seem to do word-wrap.
Is there an API call or setup that I am missing? Or do I need to draw to a memory DC and somehow rotate it to fit?
Or can someone please point me to some code that will accomplish this easily?
Thank you for your time
|
|
|
|
|
It might be Q&D, but what about drawing the text onto an in-memory bitmap/surface and then rotating it, and then blitting it to the target bitmap/surface?
Other than that, maybe the GDI+ libraries have something to offer?
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|