Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

tataxin

@tataxin
About
Posts
60
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to show a button after move it?
    T tataxin

    hi KarstendK, I don't understand what you mean. When I move the mouse over the button, it shows.

    C / C++ / MFC tutorial question

  • how to show a button after move it?
    T tataxin

    I have a button on a list, something like whenever you select a row, move the button to that row. So I implement this in OnLvnItemchangedList event:

    void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult)
    {
    ...
    // canculate the rec by seleted row
    CRect rec;
    ...

    // move button
    m_myBtn.MoveWindow(rec);
    m_myBtn.ShowWindow(SW_SHOW);
    m_myBtn.BringWindowToTop();

    InvalidateRect(rec);
    m_myBtn.RedrawWindow();

    }

    It works, but I cannot see the button. :confused::confused: If the mouse moves over the button, it shows then I can see it. I don't know why, maybe there's something wrong in my last two source code rows. Can anyone explain how to solve this?? Thank you in advance !!

    C / C++ / MFC tutorial question

  • Item changed event in CListCtrl
    T tataxin

    maybe the best way is avoid it. It's terrible the way MFC handle an event, :( anyway, thank you very much, Randor!!

    C / C++ / MFC help question

  • Item changed event in CListCtrl
    T tataxin

    does any one have any idea in this case??? help me, please!!!

    C / C++ / MFC help question

  • Item changed event in CListCtrl
    T tataxin

    uhm, I already tried return FALSE, but it's not better. .. I will try this a litter bit later. Thank you very much, David Delaune.

    C / C++ / MFC help question

  • Item changed event in CListCtrl
    T tataxin

    uhm, I'm not sure that ... Is this what you mean:

    ON_NOTIFY_REFLECT_EX(LVN_ITEMCHANGED, &CMyListCtrl::OnLvnItemchanged)

    BOOL CMyListCtrl::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
    {
    // TODO: Add your control notification handler code here
    LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR);
    *pResult = 0;
    ....
    return TRUE;
    }

    I cannot see any change ..... :(

    C / C++ / MFC help question

  • Item changed event in CListCtrl
    T tataxin

    I create a List ctrl derivered from CListCtrl. In this class, I implement item changed event

    class CMyListCtrl :
    public CListCtrl

    ....
    BEGIN_MESSAGE_MAP(CMyListCtrl, CListCtrl)
    ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, &CTrendListCtrl::OnLvnItemchanged)
    END_MESSAGE_MAP()

    ......
    void CMyListCtrl::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult) // (1)
    {
    ..
    }

    Then, on my dialog, there's a CMyListCtrl object, like this

    CMyListCtrl m_lst;

    afx_msg void OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult);

    I try to implement the item changed on that list.

    BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
    ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST_GROUP, &CMyDlg::OnLvnItemchangedList)
    END_MESSAGE_MAP()

    void CMyDlg::OnLvnItemchangedList(NMHDR *pNMHDR, LRESULT *pResult) // (2)
    {
    ...
    }

    The problem is, if I implement (1), then it doesn't run (2). And if I doesn't implement (1), it can run (2). Actually I want to run both (1) and (2). What should I do in this case? Thank you very much, bro.

    C / C++ / MFC help question

  • sprintf_s problem
    T tataxin

    I will try them now. At least the option 2 works There 're many functions similar to each other. It's so messy, and not easy to understand .... :( Thank you, Naveen.

    C / C++ / MFC database help question

  • sprintf_s problem
    T tataxin

    nice!! If we use "Use Multi-Byte Character Set", it should be "%s". Or if we use "Use Unicode Character Set", it should be "%S". Thank you, Cedric!!

    C / C++ / MFC database help question

  • sprintf_s problem
    T tataxin

    Thank you, Cedric. I just change the Character Set property to "Use Multi-Byte Character Set" and it's ok now

    modified on Thursday, July 17, 2008 9:40

    C / C++ / MFC database help question

  • sprintf_s problem
    T tataxin

    yes, Cedric. It's a Unicode project. In Project properties, The Character Set is "Use Unicode Character Set" is that wrong?

    C / C++ / MFC database help question

  • sprintf_s problem
    T tataxin

    hi, I have a sql in my program. What I want is exactly like this:

    select *
    from tbl t
    where t.name like '%xyz%'

    So in source code, I create sql like this:

    CString name = "xyz";
    ::sprintf_s(szQuery, " select * from tbl t where t.name like '%%%s%%' ", name);

    Here is szQuery when I execute

    select *
    from tbl t
    where t.name like '%x%'

    Just the first character is printed into szQuery. What's wrong here? what should I do?? Thank you in advance.

    C / C++ / MFC database help question

  • Cannot print landscape with default printer
    T tataxin

    Thank you, Nelek. I will try it now!

    C / C++ / MFC com question

  • Cannot print landscape with default printer
    T tataxin

    help me, pleasee!!!

    C / C++ / MFC com question

  • Process priority
    T tataxin

    ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
    BELOW_NORMAL_PRIORITY_CLASS 0x00004000
    HIGH_PRIORITY_CLASS 0x00000080
    IDLE_PRIORITY_CLASS 0x00000040
    NORMAL_PRIORITY_CLASS 0x00000020
    REALTIME_PRIORITY_CLASS 0x00000100

    There're some values for priority like above, you can try it!

    C / C++ / MFC question help

  • Cannot print landscape with default printer
    T tataxin

    I try to print a window, using this article: http://support.microsoft.com/kb/186736 It works, but I want to user default printer with landscape. So I try to modify the GetPrinterDC(), like this:

    HDC CLogACTsPrintHelper::GetPrinterDC(void)
    {
    CWaitCursor wait;
    PRINTDLG pdlg;
    memset( &pdlg, 0, sizeof(PRINTDLG));
    pdlg.lStructSize = sizeof(PRINTDLG);

    // use default printer
    pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC;

    // set landscape
    AfxGetApp()->GetPrinterDeviceDefaults(&pdlg);
    DEVMODE* lpDevMode = (DEVMODE*)::GlobalLock(pdlg.hDevMode);
    lpDevMode->dmOrientation = (short)DMORIENT_LANDSCAPE;
    ::ResetDC(pdlg.hDC,lpDevMode);
    ::GlobalUnlock(pdlg.hDevMode);
    // end set landscape

    PrintDlg( &pdlg );      
    
    
    return pdlg.hDC;
    

    }

    But I don't know why it return NULL??? If I comment all source code in set landscape block, it works. Or if I do not use default printer and set landscape, it work

    // do not use default printer
    pdlg.Flags = PD_RETURNDC;
    // set landscape
    ...

    Can anyone explain me what's wrong here? Thank you in advance, :)

    C / C++ / MFC com question

  • why can't I print an icon?
    T tataxin

    thank you for your reply! my printer is HP LaserJet 3052, with 1200dpi. So do you have any idea what I should do in this case?

    C / C++ / MFC question

  • how to change menu font?
    T tataxin

    sorry all, I tried to use another solution: codejock software. it's ok now, thank you friends!

    C / C++ / MFC tutorial question help

  • print a window
    T tataxin

    I have a MDI project, now I want to print the interface. So I saw this article: http://support.microsoft.com/kb/q186736/ Then I try to apply to my project, just create a menu item or button, do like this:

    // message map
    ON_COMMAND(ID_PRINT_PRINTALL, &CMyDlg::PrintGUI)

    // declare function
    afx_msg void PrintGUI();

    // implement function
    void CMyDlg::PrintGUI(){
    // get the Main window
    CWnd* a = AfxGetMainWnd();

        // print it, this function is implemented follow the above article
    PrintWindowToDC(\*a);
    

    }

    But when I run, nothing happen. Have anyone ever tried the similar thing? Please helpppppppp !!!!!!!!!!

    C / C++ / MFC com question

  • why can't I print an icon?
    T tataxin

    I want to print some icons. Here is my code:

    CDC* m_PrintDC;
    // attach m_PrintDC with printer success .....

    CPoint point(10, 10);
    HICON aIcon = AfxGetApp()->LoadIcon(IDI_ICON_CHECKEDBOX);
    m_PrintDC->DrawIcon(point, aIcon);

    //m_PrintDC->DrawText("xxxxxxxxx", &aRect,DT_SINGLELINE | DT_LEFT);

    Here IDI_ICON_CHECKEDBOX is a icon ID that I draw. But it doesn't work, I don't know why?? I can print some text with DrawText(...). Anyone know what's wrong here? Thank you in advance.

    C / C++ / MFC question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups