Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
I think the problem is due to stricter type checking in .NET version of MFC: the message handlers must have the right signature, which is not the case for CTextProgressCtrl::OnSetText and CTextProgressCtrl::OnGetText. I've made the following changes and things seem to work:
// TextProgressCtrl.h
...
//    afx_msg LRESULT OnSetText(UINT, LPCTSTR szText);
//    afx_msg LRESULT OnGetText(UINT cchTextMax, LPTSTR szText);
    afx_msg LRESULT   OnSetText(WPARAM, LPARAM);
    afx_msg LRESULT   OnGetText(WPARAM, LPARAM);
 
// TextProgressCtrl.cpp
...
LRESULT CTextProgressCtrl::OnSetText(WPARAM, LPARAM lParam)
{
    LPCTSTR szText=(LPCTSTR)lParam;
    LRESULT result = Default();
 
    if ( (!szText && m_strText.GetLength()) ||
         (szText && (m_strText != szText))   )
    {
        m_strText = szText;
        Invalidate();
    }
 
    return result;
}
 
LRESULT CTextProgressCtrl::OnGetText(WPARAM cchTextMax, LPARAM lParam)
{
    LPTSTR szText=(LPTSTR)lParam;
 
    if (!_tcsncpy(szText, m_strText, cchTextMax))
        return 0;
    else 
        return min(cchTextMax, (UINT) m_strText.GetLength());
}
Hope this helps.


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
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(…) Pin
anderslundsgard6-Sep-04 21:58
anderslundsgard6-Sep-04 21:58 
GeneralRe: ShellExecute(…) Pin
Darren_vms6-Sep-04 22:59
Darren_vms6-Sep-04 22:59 
GeneralRe: ShellExecute(…) 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 
GeneralRe: How to import library? Pin
eli150219796-Sep-04 20:58
eli150219796-Sep-04 20:58 

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.