|
Put the bitmap in a static picture control and pass the address of the control to AddTool() .
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
By a static picture you meant a static CBitmap object? How I can pass the address? Sorry for the questions, I'm starting with MFC
Luis E. Cuadrado
)
|
|
|
|
|
Luis E. Cuadrado wrote:
By a static picture you meant a static CBitmap object?
Not quite. The resource editor contains a "picture" control (that happens to be derived from CStatic , but that's not important). Add the control to your dialog and select the bitmap image (eg: IDC_MYBITMAP ) to be displayed in the control. All this is done within the resource editor.
In your code, you can manipulate the picture control just like any other control. If the id of the picture control is IDC_FOO , you can set its tooltip by doing:
CWnd* pWnd = GetDlgItem (IDC_FOO);
ASSERT (pWnd != NULL);
m_ToolTip.AddTool(pWnd, _T("This is a picture"));
Luis E. Cuadrado wrote:
Sorry for the questions, I'm starting with MFC
Please don't apologize! We're here to help!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
does c++ support a 'this' operator? i'm wondering if you can do something like this in c++:
//java syntax -
class Person{
//members
Person(){
// init defaults
}
Person(int id){
this(); // <-- call 0 param constructor for init defaults
m_id = id;
}
}
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Nope.
People usually just end up making a common init routine.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
C++ does support a this pointer, which points to the current instance and is secretly passed to member method.
You cannot explicitly call another constructor. Just make a private initialization routine for the common initialization code.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I got a Property sheet with some pages on it in wizard style. On first page i am disabling the back and next button. The next button gets enabled when user enters something into edit control of page i.e. first page. Since Back and Next buttons are disabled while dispalying sheet, the cancel button is becoming as Default button. Now i want to make Next burtton as Default button as soon as user enters something into Edit control. So please give me suggestion or solution on this. Thanks for everything.
|
|
|
|
|
That should happen automatically. What code do you use to re-activate the Next button?
Good Luck,
Bill
|
|
|
|
|
Thanks Bill. Here is the scenario.
I am enabling the Next button as soon as user enters something into Edit control. I mapped a message of edit control ON_EN_CHANGE in this function i am checking edit control is empty or not. If it is not empty then i am getting a pointer to next button from Sheet by using GetDlgItem(ID_WIZNEXT) and calling EnableWindow(TRUE). Now it is working perfectly as far as Enbling concerned. I want Next button as Default as soon as it gets enabled.
Once again Thanks.
|
|
|
|
|
Try using void SetWizardButtons( DWORD dwFlags );
It is a method of the parent property sheet. Its use is like this:
Here is a snip from my last project that implemented wizards:
CPropertySheet* pParent = (CPropertySheet*)GetParent();
ASSERT_KINDOF (CPropertySheet, pParent);
pParent->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK); // Disable buttons
Hope this helps,
Bill
|
|
|
|
|
Thanks Bill
Yes it worked out...
|
|
|
|
|
I place certain font file in the windows fonts directory. It gets automatically register in the registry. At that time my application and other applications properly loads the font. But sometimes font automatically disappeaared both from fonts directory and registry especially when i restart my computer. Sometime when i refresh the fonts folder, the font appears again and related applications starts loading it normally. Can anyone tell me whats the problem
Bakhtawar
|
|
|
|
|
Hello,
I want to TextOut values on a bitmap, but coordinates for one view does not corespond to coordinates on other views and resolutions. What can I do ? For example pDC->TextOut(100,100,myvalue) -> 100,100 is good just for one view and that's the one I start with. I tried some formulas of conversion but still my application depends on the starting resolution. If the computer I launch my application on doesn't have the same resolution as the one I made my app on then I'm screwed.
All I want is to match the values I take from a file with cities on the map. The DrawText() method can't be given values that I want and I wasn't able to find any class the helps with that.
Can anyone help me ? I'm really out of ideas.
|
|
|
|
|
Use specific mapping mode. That should solve your problem
as they are independant of the resolutions of a moniter.
And then yuo can use the foll. fns
DPtoHIMETRIC Converts device units into HIMETRIC units.
DPtoLP Converts device units into logical units.
HIMETRICtoDP Converts HIMETRIC units into device units.
HIMETRICtoLP Converts HIMETRIC units into logical units.
LPtoDP Converts logical units into device units.
LPtoHIMETRIC Converts logical units into HIMETRIC units.
|
|
|
|
|
I am not completely sure what your problem is, but you can get the current size of a window/view by calling its GetClientRect() method, and if you need the current screen resolution take a look at ::GetSystemMetrics().
--
Dana Holt
Xenos Software
|
|
|
|
|
Hi everyone,
How can I detect what microsoft softwares are installed on a machine using a VC++ code .. I have tried using APIs like "MsiGetProductInfo" & "MsiEnumProducts",but no luck,it dint give wheter IIS,IE etc is installed or not ..Please let me know if anyone knows an answer to this
Prasad
|
|
|
|
|
scanning the registry I suggest.
|
|
|
|
|
I always scan for registry keys that the software I am interested in makes. There is also a function, FindTarget seems to ring a bell, that will take a file name and give you the application that handles it.
--
Dana Holt
Xenos Software
|
|
|
|
|
How do I get a second dialog to redraw/repaint to show changes they are taking place to the buttons on the page.
The buttons are set and change color according to the input read by the dialog. I have been doing all this using a timer, but it only redraws when the mouse leaves that window and then returns.
Any ideas on how to get this to keep up with the data?
thanks
|
|
|
|
|
You can force a redraw on any window by
using
Invalidate() ;
UpdateWindow() ;
|
|
|
|
|
Prem,
Though this solution works the flickering it creates is unbearable.
I really just need for the buttons to show there "new" state.
Thanks.
|
|
|
|
|
You need to reduce the amt of times the button is getting updated.
Look at the code and see if you can reduce the amt of times you are updating
and actually allow updation when you actually changed the color
or length of the drawing.(you save the state and compare or
you will call the update only when the state changes)
|
|
|
|
|
I need some help getting a printout of the class view. I'm trying to work through someone else's code, and would like a hard copy list of classes, member functions, variables, etc.
If I can't do this through VS, is there any easy means of getting the info. It doesn't have to look pretty.
Thanks, Brian Welsch
{insert witty/thought-provoking saying here}
|
|
|
|
|
Hi Brian,
I think instead of printing classes you might find this tool better:
http://sources.redhat.com/sourcenav
And it supports printing 'class view' as well.
Martin
|
|
|
|
|
Hi,
I dont know of any way we can do it thru VS ,
but there is another tool which can basically create
class listings, cross refernces in the form of html
pages(it actually almost equal to Browse Info)
and you can take a print out of the html pages.
Here is the link.
http://www.stack.nl/~dimitri/doxygen/download.html
|
|
|
|