Click here to Skip to main content
16,004,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDirectory-tree in a Combobox Pin
GDavy7-Sep-04 0:00
GDavy7-Sep-04 0:00 
GeneralRe: Directory-tree in a Combobox Pin
David Crow7-Sep-04 2:48
David Crow7-Sep-04 2:48 
QuestionCan I add a CButton to a CScrollView? [MFC] Pin
Magnus7656-Sep-04 23:38
Magnus7656-Sep-04 23:38 
AnswerRe: Can I add a CButton to a CScrollView? [MFC] Pin
David Crow7-Sep-04 2:50
David Crow7-Sep-04 2:50 
GeneralRe: Can I add a CButton to a CScrollView? [MFC] Pin
Magnus7657-Sep-04 23:44
Magnus7657-Sep-04 23:44 
Generalrror LNK2001: unresolved external symbol Pin
manikanth6-Sep-04 23:21
manikanth6-Sep-04 23:21 
GeneralRe: rror LNK2001: unresolved external symbol Pin
Joaquín M López Muñoz6-Sep-04 23:35
Joaquín M López Muñoz6-Sep-04 23:35 
QuestionHow to add text to a progress bar? (i have looked at the examples here and still have problems) Pin
m_dale6-Sep-04 23:06
m_dale6-Sep-04 23:06 
I want to display the % completed on top of my progress bar.
I was looking around on here and found what seems to be the perfect solution:
http://www.codeproject.com/miscctrl/text_progressctrl.asp

HOWEVER:
That was last updated in VC++ 6.
I'm using VC++ 7 (aka VC++ .NET), and it won't compile it.
There's something wrong with the message map handlers (in that thier typing is incorrect somehow) but I can't figure out for the life of me how to fix it.

I have a fair ammount of C/C++ experience but only 2 weeks of Visual C++ and MFC experience (!) so I'm not entirely sure on all the Microsoft defined types etc.
The other thing that's throwing me is that these are (possibly) scope errors, and so far as I can see the function definitions and declarations are in scope.

Here's an example of what I'm getting:
<br />
c:\Documents and Settings\xxxxxx\Desktop\progress temp\TextProgressCtrl.cpp(158) : error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CTextProgressCtrl::* )(WPARAM,LPTSTR)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'<br />
        None of the functions with this name in scope match the target type<br />


That is generated from the following member function/function call.
PLEASE NOTE THAT THE FUNCTION IS DECLARED PRIVATE! But this shouldn't matter because the message map is in the .cpp which is within scope of private for that class, right?

Message map (in .cpp)
ON_MESSAGE(WM_GETTEXT, OnGetText)

Definition (in .cpp)
LRESULT CTextProgressCtrl::OnGetText(WPARAM cchTextMax, LPTSTR szText)<br />
{<br />
    if (!_tcsncpy(szText, m_strText, cchTextMax))<br />
        return 0;<br />
    else <br />
        return min(cchTextMax, (UINT) m_strText.GetLength());<br />
}<br />


Declaration (in .h)
afx_msg LRESULT OnGetText(WPARAM cchTextMax, LPTSTR szText);<br />



Any help very much appreciated.
AnswerRe: How to add text to a progress bar? (i have looked at the examples here and still have problems) Pin
Joaquín M López Muñoz6-Sep-04 23:51
Joaquín M López Muñoz6-Sep-04 23:51 
GeneralRe: How to add text to a progress bar? (i have looked at the examples here and still have problems) Pin
m_dale7-Sep-04 22:03
m_dale7-Sep-04 22:03 
GeneralReterive OCX properties through HWND Pin
mohandasgandhiG6-Sep-04 22:51
mohandasgandhiG6-Sep-04 22:51 
QuestionHow to import library? Pin
eli150219796-Sep-04 22:09
eli150219796-Sep-04 22:09 
AnswerRe: How to import library? Pin
Arsalan Malik6-Sep-04 23:10
Arsalan Malik6-Sep-04 23:10 
GeneralRe: How to import library? Pin
eli150219797-Sep-04 2:20
eli150219797-Sep-04 2:20 
GeneralShellExecute(&#8230;) Pin
anderslundsgard6-Sep-04 21:58
anderslundsgard6-Sep-04 21:58 
GeneralRe: ShellExecute(&#8230;) Pin
Darren_vms6-Sep-04 22:59
Darren_vms6-Sep-04 22:59 
GeneralRe: ShellExecute(&#8230;) Pin
Darren_vms6-Sep-04 23:05
Darren_vms6-Sep-04 23:05 
Generalabout the key of POWER on the keyboard Pin
yingkou6-Sep-04 21:18
yingkou6-Sep-04 21:18 
GeneralRe: about the key of POWER on the keyboard Pin
David Crow7-Sep-04 2:55
David Crow7-Sep-04 2:55 
Generalthanks a lot Pin
yingkou7-Sep-04 15:13
yingkou7-Sep-04 15:13 
Questionhow to use SEH Pin
yingkou6-Sep-04 21:08
yingkou6-Sep-04 21:08 
AnswerRe: how to use SEH Pin
Joaquín M López Muñoz6-Sep-04 21:16
Joaquín M López Muñoz6-Sep-04 21:16 
Generalthanks a lot Pin
yingkou6-Sep-04 21:35
yingkou6-Sep-04 21:35 
QuestionHow to import library? Pin
eli150219796-Sep-04 20:42
eli150219796-Sep-04 20:42 
AnswerRe: How to import library? Pin
Arsalan Malik6-Sep-04 20:48
Arsalan Malik6-Sep-04 20:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.