CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: MiMec

Page 1 of 2 1 2

Search: Search took 0.15 seconds.

  1. Replies
    1
    Views
    1,437

    Rich Edit and WM_PRINT

    I have a rich edit control and I want to add some kind of a selection bar on the left side of it. I need to paint this bar on my own (gray background, images etc.).

    The problem is that the rich...
  2. Maybe you could put a value in the registry that...

    Maybe you could put a value in the registry that works as a counter of the instances of your app and then divide the time equally between all instances?
  3. Add OnCtlColor() to your dialog window, check the...

    Add OnCtlColor() to your dialog window, check the control's ID and use pDC->SetTextColor() with your color.
  4. Replies
    71
    Views
    4,968

    I don't have the full MSDN installed (just the...

    I don't have the full MSDN installed (just the docs about MFC, C++ libraries and so on). But I have the Platform SDK update which contains very good documentation with clear function descriptions and...
  5. Replies
    6
    Views
    1,217

    Wait a minute. A toolbar button is not a control...

    Wait a minute. A toolbar button is not a control (like a dialog button) so you can't attach it to a CButton. Use CToolbarCtrl member function to manipulate buttons.
  6. Well... when they say something is unsupported...

    Well... when they say something is unsupported under Win95, it means that it will fail if you try to do it. That's why you should always check the result and use some default value.
  7. Thread: Mouse Controling

    by MiMec
    Replies
    2
    Views
    668

    The ClipCursor() function confines the cursor to...

    The ClipCursor() function confines the cursor to a rectangular area on the screen.
  8. Just use the default value (in this case 3) if...

    Just use the default value (in this case 3) if the function fails.
  9. Thread: Toolbar In CView

    by MiMec
    Replies
    7
    Views
    3,177

    Update commands are by default sent to the active...

    Update commands are by default sent to the active view only. Try adding the following to CMainFrame to change this routing:



    BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra,...
  10. Replies
    2
    Views
    662

    I use an owner-drawn button and the following...

    I use an owner-drawn button and the following code:



    void CAboutDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
    {
    if (nIDCtl==IDC_LINK)
    {
    CString strURL;...
  11. Thread: CComboBox

    by MiMec
    Replies
    1
    Views
    1,175

    The MSDN says that the edit control sends...

    The MSDN says that the edit control sends WM_CTLCOLOREDIT to its parent (which is the combo box in this case). This message is handled by
    CWnd::OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );...
  12. Thread: Logfont

    by MiMec
    Replies
    2
    Views
    660

    The easier way to create a font is...

    The easier way to create a font is CFont::CreatePointFont() where you only need to pass the size (multiplied by 10) and name. LOGFONT is useful if you have to specify all these bold, italic,...
  13. Thread: Runing a program

    by MiMec
    Replies
    5
    Views
    817

    Your can do it this way: ...

    Your can do it this way:

    ShellExecute(::GetDesktopWindow(), "open", "YourApp.exe", NULL, "C:\", SW_SHOWNORMAL);
  14. Remove "->m_pMainWnd" and it should work. You...

    Remove "->m_pMainWnd" and it should work. You were trying to get the main window and cast it ta an application object. That's why it chrashes.
  15. Thread: Runing a program

    by MiMec
    Replies
    5
    Views
    817

    use ShellExecute() :)

    use ShellExecute() :)
  16. You have to read the variable from the...

    You have to read the variable from the CMainDialog object that opens the subdialog. When you create a temporary (local)CMainDialog object, it contains nothing. It's a different instance.
    What you...
  17. Replies
    5
    Views
    977

    The window that previously had focus is passed to...

    The window that previously had focus is passed to CWnd::OnSetFocus(). You can store its handle (not the pointer itself!) for later use.
  18. Replies
    2
    Views
    783

    You have to do something like this: int sec...

    You have to do something like this:


    int sec = timespan.GetTotalSeconds();
    sec = (int)(sec * 10.5);
    timespan = CTimeSpan((time_t)sec);
  19. Replies
    4
    Views
    981

    Since CPoint is a really simple object, I don't...

    Since CPoint is a really simple object, I don't see any reasons not to return it from a function, as well as pass it as a argument etc. Returning a reference allows anyone to modify this object and...
  20. Thread: String resource

    by MiMec
    Replies
    7
    Views
    914

    Why don't you just use a simple array of structs...

    Why don't you just use a simple array of structs containing int id nad char* string pairs?
  21. It's easier to check if the HWND of toolbar is...

    It's easier to check if the HWND of toolbar is not null in OnSize(), this way you don't need an extra variable. In fact WM_SIZE is often sent to a window before its children have been created.
  22. Replies
    3
    Views
    672

    You have to use the report list style having one...

    You have to use the report list style having one column as wide
    as the list. You can use GetClientRect() to find the width and decrease it by some number for the scrollbar to fit.
  23. Try calling SeekToEnd() before writing, to append...

    Try calling SeekToEnd() before writing, to append data to the end of the file.
  24. Thread: CEditbox

    by MiMec
    Replies
    7
    Views
    1,200

    When you press ENTER in a dialog, it activates...

    When you press ENTER in a dialog, it activates the default button, so if you have an OK button the dialog will be closed. KillFocus is sent when the user deactivates the control (by pressing TAB or...
  25. Thread: CEditbox

    by MiMec
    Replies
    7
    Views
    1,200

    If this is a single line edit box, it cannot have...

    If this is a single line edit box, it cannot have a '\n' at the end.
Results 1 to 25 of 48
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured