|
Did you search on www.codeproject.com and www.codeguru.com
|
|
|
|
|
google
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Greetings,
I have an MDI with one view and a control dlg. I want the control dialog to be on the left so I give it the CBRS_LEFT setting. When it launches, it is momentarily on the left, then when the main view is drawn, it goes on top of the main view. How do I force it to stay on the left?
Thank you.
Sincerely,
BP
|
|
|
|
|
Cannot you please help me in my problem. I'm programming with VC++ 6.0 using MFC. I've placed a picture on the background of the object of CTreeCtrl class. I want elements of the tree to be transparent for user to see background through them. So, I want to see tree-structured text over the picture. Please help me.
|
|
|
|
|
You could probably derive a new class from CTreeCtrl and override the OnEraseBkgnd function. In OnEraseBkgnd, draw your background image to the CDC and return 1 to indicate you've handled it. Haven't tried it, but it theoretically should work.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
|
|
This is quite close to what I need. Thank you very much, because I failed to find this thing on CodeProject. But this is not exactly what I need, because the author implements his own drawing mechanism. Unfortunately CTreeCtrl does not support owner-drawing as, for example, CListCtrl (it has DrawItem member), so author reimplemented OnPaint. This causes that this tree doesn't look like standard Windows tree control and moreover doesn't support standard tree features, like check-boxed and bold-marked item (I use both these things). Obviously, I can implement this over VividTree, but I wonder, why I cannot use some standard capabilities for this. For example, I can see such a tree in Windows Explorer and other software. How can I access this component? Please, help me.
|
|
|
|
|
dum wrote: Unfortunately CTreeCtrl does not support owner-drawing as, for example, CListCtrl (it has DrawItem member), so author reimplemented OnPaint.
Actually it does, through WM_NOTIFY, NM_CUSTOMDRAW and the NMCUSTOMDRAW structure. Look this up on MSDN.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thanks, I've made this another way (see the post nearby if you would like to).
|
|
|
|
|
|
I'm trying to load a jpeg file and display it into a static picture control. I'm using Microsoft Studio 2006.
What I tried doing was to use the CImage class, load the file and then try to get the handle to the HBITMAP. The code for this is:
CImage m_image;
CStatic m_imageStatic;
if(S_OK == m_image.Load("image.jpg"))
{
m_imageStatic.SetBitmap((HBITMAP)m_image);
}
When the load is completed m_image contains the right hight and width, but the m_hBitmap variable in the CImage object is unused. So when I use the HBITMAP operator I get a crash.
I'm doing this in the constructor of a dialog class (the one that has the static picture). Would this be a problem?
Does anyone have any idea of what I could do to make it work? Or if I can't do things this way, how could I display a jpeg file into a dialog window?
|
|
|
|
|
If you coded it as shown then your m_imageStatic hasn't been created yet (no HWND) when you call
m_imageStatic.SetBitmap(...). That won't work
|
|
|
|
|
Thanks a lot Mark! Now I realised what went wrong. I over-wrote OnInitDialog and did the loading there and everything works fine now.
|
|
|
|
|
you can use of
<br />
CImage m_image;<br />
if(S_OK == m_image.Load("image.jpg"))<br />
{ <br />
m_imageStatic.SetBitmap(m_image.Detach());<br />
}<br />
|
|
|
|
|
Say I have a class
template<T>
class CMyArray
{
public :
Add (..)
..
..
private :
list<T>m_list ; // STL List
}
Now if i create two objects
CMyArray<CString> a ;
CMyArray<CString> b ;
a.Add("A1");
a.Add("B2");
b = a ;
Without explicity implementing an assignment operator , is it safe to do the above assignment ?
|
|
|
|
|
Its safe in this case. As compiler provides its own version . Which does bitwise copy. And std::list has assignment operator overloaded.
But you need to be carefull, if you have member variable which allocates memory dynamically.
|
|
|
|
|
Hi,
I've implemented a static splitter view in a MDI project. It contains 1 row and 2 columns. The left column contains a grid control and the right column contains a charting control, nested on a CFormView. Now, I want the FormView which contains the chart control to change its size when I change the size of the splitter window. I know if I change the size of a FormView or a dialog it's very easy. You only have to call GetSafeHwnd() for the control and than MoveWindow with the new coordinates. But how do I change the size of the FormView itself inside the splitter window?
Thanks,
Frank.
|
|
|
|
|
Hai all,
I have created several Buttons using TBBUTTON structure on
CToolBarCtrl. And I added Button Text Using AddString function of CToolBarCtrl.
But
How can I change The text on a Button in run time
and also
How can I get the Text on a Button in run time
Using its IDs,
Please Help me.
Thanks in Advance
George
|
|
|
|
|
georgekjolly wrote: How can I change The text on a Button in run time
You could use CToolBarCtrl::SetButtonInfo().
georgekjolly wrote: How can I get the Text on a Button in run time
CToolBarCtrl::GetButtonInfo()?
|
|
|
|
|
Hai Mark ,
I have used it , following codes shows it
/***************code stats here***************/
TBBUTTONINFO ptbbi ;
GetButtonInfo( ID_BUTTON_LOGIN, &ptbbi );
ptbbi.pszText = "Logout";
SetButtonInfo( ID_BUTTON_LOGIN, &ptbbi );
/*********code ends here*************************/
Is it the right way of doing it.
Thanks
george
|
|
|
|
|
I believe so. The only thing I'd add is make sure TBBUTTONINFO.dwMask is set for the info you
want to change on the button:
TBBUTTONINFO ptbbi ;
GetButtonInfo( ID_BUTTON_LOGIN, &ptbbi );
ptbbi.dwMask = TBIF_COMMAND | TBIF_TEXT;
ptbbi.pszText = "Logout";
SetButtonInfo( ID_BUTTON_LOGIN, &ptbbi );
Does that work?
Mark
|
|
|
|
|
can any body suggest me how can i devolop an intermediate device driver
passthru driver which can be hyperthreaded in HT multicore machine
vineesh
|
|
|
|
|
I am writing an MFC application which has a CPropertySheet and a number of CPropertyPages. The application uses a manifest to use the XP themed common controls, and in general this works fine.
However, I've got one page of the sheet where the background of the page does not get themed correctly. This seems to be because the only control on the page is a CListCtrl - if I add a CButton or a CStatic then its fine, but I would really rather not add one.
An example of this can be found in XP itself in the file properties dialog - the summary tab on file properties has the incorrect background compared to all other pages. I'm guessing the controls on there are hidden / dynamically created, and so it behaves like an empty page.
Does anyone know why this happens? Presumably there is some behaviour in CPropertyPage that depends upon the child controls? Or is this fundamentally outside of my control, and I should put up with needing a CStatic?
Cheers
|
|
|
|
|
I have never before so much as looked at the docs for GDI+, so please forgive me if my questions are a little too simplistic.
I am thinking of converting my application to use GDI+, but after flicking through the docs on MSDN I'm not sure if there would be an advantage. My app is basically a skinning library. For each window there can be up to 9 bitmaps. Currently I am relying heavily on regions to both draw these bitmaps and to clip windows from parents. Creating a region from a bitmap in GDI is quite painless (using DIBs), but how would it be done in GDI+?
|
|
|
|