|
KarstenK wrote: The string types are sometimes tricky, they are macros with different values for Multibyte or Unicode. The online docs at msdn.com are a rich source of information.
If you want to buy VS, you need to choose one of the many different versions. There are also special prices for students.
Probably he already knows about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Anthony Appleyard wrote: Where can I get the MSDN Library from?
The library is available on line at msdn.microsoft.com, but access is slow. When you buy VC++, you usually get a version of MSDN with it, and you can also subscribe to it and get up to date versions of the library every three months.
Also, if VC2008 doesn't support resource editing, it is definitely cripple ware.
Nathan
|
|
|
|
|
I am using a tab control. I want to change the background colour of the tab control. I selected the ownerdrawfixed in the properties of the tab control. but still the execution does not come to OnDrawItem function
S.Yamini
|
|
|
|
|
What are you trying to do it?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
I am trying to change the background colour of the tab control. I will be able to it in drawitem method but the execution does not come to draw item method even if i select ownerdrawfixed in the properties of the tab control.
|
|
|
|
|
Where are you handling WM_DRAWITEM?
What about overriding CTabCtrl::DrawItem() in your tab control class?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The execution does not come to drawitem method. Why
|
|
|
|
|
The following code works for me...
Note you have to have a tab control subclassed by an object of your
CTabCtrl-derived class, otherwise DrawItem() will never get called...
class CMyTabCtrl : public CTabCtrl
{
public:
CMyTabCtrl() : CTabCtrl() {}
virtual void DrawItem(LPDRAWITEMSTRUCT );
};
void CMyTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
if (0 == lpDrawItemStruct->itemID)
dc.DrawText(_T("Tab 1"), &lpDrawItemStruct->rcItem, DT_CENTER);
else
dc.DrawText(_T("Tab 2"), &lpDrawItemStruct->rcItem, DT_CENTER);
dc.Detach();
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks for ur help
I created a dialog based application.
I selected a tab control and moved to my dialog .
I have created an MFC class named CMyTabCtrl derived from CTabCtrl.
I added ur code to it.
I created a member variable in the dialog class for the tab control using class wizard which is
CMyTabCtrl m_Tab
I have selected the owner draw fixed properties
But still the drawitem of CMyTabCtrl does not called.
Please implement this and if u r getting let me know what u did.
|
|
|
|
|
I did the same - I used a DDX_Control() call in DoDataExchange() to
subclass the control...
void CMyDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB1, m_Tab); <-- make sure you use the right ID!!!
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have done that. But still does not work
Can u send me ur sample project.
|
|
|
|
|
It's a VS2008 project - is that OK?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Am I doing anything wrong in setting the properties of the tab control.
Shall I send the sample code.
|
|
|
|
|
It seems like you're doing everything....
Send me an email from here and I'll reply with the project.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am waiting for ur reply
|
|
|
|
|
It works now when i call insert item
Thanks
|
|
|
|
|
Ohhh you had no tabs
I guess the email through CodeProject isn't working yet....I sent one
so I could get your address to send the project.
Glad you got it working!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
You're welcome!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I forgot how to read from a text file, line by line, help!
|
|
|
|
|
CStdioFile::ReadString
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Thanks Johpoke it worked, and thanks to the other guys too for their responses.
|
|
|
|
|
i have a file which contains hex values. i want to convert that to human readable form. please give me some leads.
|
|
|
|