Click here to Skip to main content
15,891,014 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to send a text file from C to java and receive the same text file from java to C Pin
venkat28vk18-Aug-15 20:57
venkat28vk18-Aug-15 20:57 
AnswerRe: How to send a text file from C to java and receive the same text file from java to C Pin
Richard MacCutchan18-Aug-15 21:53
mveRichard MacCutchan18-Aug-15 21:53 
QuestionRe: How to send a text file from C to java and receive the same text file from java to C Pin
David Crow19-Aug-15 5:24
David Crow19-Aug-15 5:24 
AnswerRe: How to send a text file from C to java and receive the same text file from java to C Pin
ThatsAlok20-Aug-15 0:23
ThatsAlok20-Aug-15 0:23 
GeneralOT Pin
CPallini20-Aug-15 0:35
mveCPallini20-Aug-15 0:35 
GeneralRe: OT Pin
ThatsAlok20-Aug-15 1:51
ThatsAlok20-Aug-15 1:51 
GeneralRe: OT Pin
ThatsAlok20-Aug-15 1:53
ThatsAlok20-Aug-15 1:53 
QuestionCMFCToolBarComboBoxButton::GetByCmd returns NULL Pin
joliet17-Aug-15 20:26
joliet17-Aug-15 20:26 
I created a CMFCToolBarComboBoxButton in a CMFCToolBar as following:
C++
afx_msg LRESULT CMainFrame::OnToolbarReset(WPARAM wp, LPARAM lp)
{
    UINT uiToolBarId = (UINT) wp;
    if (uiToolBarId == IDR_TOOLBAR_FILES)
    {
        CMFCToolBarComboBoxButton omboButton1(IDC_SRC_PRO_LIST, GetCmdMgr ()->GetCmdImage(IDC_SRC_PRO_LIST, FALSE), CBS_DROPDOWNLIST);
	
        comboButton1.EnableWindow(FALSE);
        comboButton1.SetCenterVert();
        comboButton1.SetDropDownHeight(200);
        comboButton1.SetFlatMode();
        m_wndFilesBar.ReplaceButton (IDC_SRC_PRO_LIST, comboButton1);
     }
}

It runs well.
But when I want to add some content into it from another thread.I defined a function:
C++
int CMainFrame::CBAddItem(LPCTSTR lpszItem, DWORD_PTR dwData)
{
    int r = -1;
    CMFCToolBarComboBoxButton* pSrcCombo = CMFCToolBarComboBoxButton::GetByCmd (IDC_SRC_PRO_LIST);
    if(pSrcCombo)
    {
        r = pSrcCombo->AddItem(lpszItem, dwData);
    }
    return r;
}

The function CMFCToolBarComboBoxButton::GetByCmd always return NULL. And I traced this function, found:

C++
int __stdcall CMFCToolBar::GetCommandButtons(UINT uiCmd, CObList& listButtons)
{
    .....	
    for (POSITION posTlb = afxAllToolBars.GetHeadPosition(); posTlb != NULL;)
    {
        CMFCToolBar* pToolBar = (CMFCToolBar*) afxAllToolBars.GetNext(posTlb);
        ENSURE(pToolBar != NULL);

        if (CWnd::FromHandlePermanent(pToolBar->m_hWnd) != NULL)

CWnd::FromHandlePermanent(pToolBar->m_hWnd) always return NULL.
So why?
AnswerRe: CMFCToolBarComboBoxButton::GetByCmd returns NULL Pin
Jochen Arndt17-Aug-15 20:59
professionalJochen Arndt17-Aug-15 20:59 
QuestionAdjust paper size Pin
Erich Ruth17-Aug-15 10:02
Erich Ruth17-Aug-15 10:02 
AnswerRe: Adjust paper size Pin
Kenneth Walters17-Aug-15 11:09
Kenneth Walters17-Aug-15 11:09 
QuestionWindows 10 & WM_QUERY_ENDSESSION/WM_ENDSESSION Pin
Peter Weyzen17-Aug-15 4:51
Peter Weyzen17-Aug-15 4:51 
Questionc++ Qt or C# or JAVA !! Pin
Dreamer_X15-Aug-15 3:51
Dreamer_X15-Aug-15 3:51 
AnswerRe: c++ Qt or C# or JAVA !! Pin
OriginalGriff15-Aug-15 3:54
mveOriginalGriff15-Aug-15 3:54 
AnswerRe: c++ Qt or C# or JAVA !! Pin
ThatsAlok20-Aug-15 0:24
ThatsAlok20-Aug-15 0:24 
QuestionFirst button of toolbar control get activated after another button get executed Pin
Amrit Agr14-Aug-15 1:35
Amrit Agr14-Aug-15 1:35 
QuestionCheckbox: SetFocus() doesn't draw broken rectangle around it Pin
Donguy197613-Aug-15 13:39
Donguy197613-Aug-15 13:39 
AnswerRe: Checkbox: SetFocus() doesn't draw broken rectangle around it Pin
Arthur V. Ratz13-Aug-15 19:13
professionalArthur V. Ratz13-Aug-15 19:13 
QuestionLearning C++ Pin
Kevin Marois13-Aug-15 11:12
professionalKevin Marois13-Aug-15 11:12 
AnswerRe: Learning C++ Pin
jeron113-Aug-15 12:09
jeron113-Aug-15 12:09 
GeneralRe: Learning C++ Pin
Kevin Marois13-Aug-15 12:13
professionalKevin Marois13-Aug-15 12:13 
AnswerRe: Learning C++ Pin
Nitin K. Kawale17-Aug-15 1:55
professionalNitin K. Kawale17-Aug-15 1:55 
QuestionURLDownloadToFile stopped working on Windows 10 Pin
DavidBaird12-Aug-15 13:18
DavidBaird12-Aug-15 13:18 
SuggestionRe: URLDownloadToFile stopped working on Windows 10 Pin
Ujesh Mohanan13-Aug-15 3:30
Ujesh Mohanan13-Aug-15 3:30 
GeneralRe: URLDownloadToFile stopped working on Windows 10 Pin
DavidBaird13-Aug-15 10:43
DavidBaird13-Aug-15 10:43 

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.