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

Search:

Type: Posts; User: TubularX

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    613

    Re: Validate unsigned operations?

    Yes, it's legal, but I can't recall that I have ever done it on purpose. Maybe that behaviour is defined just because it's better than the alternative of undefined behaviour?

    Writing unit tests is...
  2. Replies
    6
    Views
    613

    Validate unsigned operations?

    Hello,

    I don't know if this is a common problem, but I've sometimes encountered unexpected runtime issues caused by unsigned values being decremented below zero.

    Example 1: "unsigned_value +=...
  3. Replies
    9
    Views
    506

    Re: Passing NULL to a pointer parameter

    It's recommended to pass nullptr instead of NULL macro.
  4. Replies
    2
    Views
    1,009

    Re: Battleship Game

    First of all, I guess this question is not really related to Visual C++. It's about design decisions, maybe you should try another forum?

    Now, to try to answer your question... In an object...
  5. Replies
    5
    Views
    954

    Re: ChoosePixelFormat NULL handle?

    OK, that makes sense. Thank you! I will investigate and debug on some other hardware as well.
  6. Replies
    5
    Views
    954

    Re: ChoosePixelFormat NULL handle?

    It's not NULL. The device context is retrieved from a window and should be valid. I can use the handle later with DrawText and see the results. ChoosePixelFormat returns a non-zero value, so...
  7. Replies
    5
    Views
    954

    ChoosePixelFormat NULL handle?

    PIXELFORMATDESCRIPTOR pfd = {
    sizeof (PIXELFORMATDESCRIPTOR), // Size of this structure
    1, // Version number
    PFD_DRAW_TO_WINDOW | ...
  8. Replies
    4
    Views
    777

    Re: Showing dialog in DLL

    Thanks Igor!!

    Sorry about that. I was so certain that I already tried that. I must have made a mistake then, since it obviously works :-)
  9. Replies
    4
    Views
    777

    Showing dialog in DLL

    I create a dynamic library, using "MFC in a Shared DLL".

    I export a test method:

    h-file:


    class CMyClass
    {
    public:
  10. Replies
    1
    Views
    550

    Layered dialog, stay on top?

    Did anyone create a modeless dialog as a layered window and successfully made it stay "on top" (always visible) ? I can't make it work in Windows XP.

    I created a dialog class from CDialogEx, set...
  11. Replies
    0
    Views
    483

    Disable Ribbon Category?

    Hello!

    How can I disable a category of CMFCRibbonBar? In other words, I want the text in the category tab to be grayed out and ignore any clicks on it to prevent its elements from being shown. In...
  12. Replies
    0
    Views
    362

    How to omit MFC menu?

    How can I skip creation of the main menu when MainFrame is derived from CMDIFrameWndEx?

    I tried following the same steps as with CMDIFrameWnd (http://support.microsoft.com/kb/131368). However,...
  13. Replies
    4
    Views
    732

    Re: CMFCRibbonQuickAccessCustomizeButton

    @Victor,

    Sorry, let me clarify...

    GetID is a method of CMFCRibbonBaseElement (and CMFCRibbonQuickAccessCustomizeButton is derived from this class). It returns the command ID according to MSDN...
  14. Replies
    4
    Views
    732

    Re: CMFCRibbonQuickAccessCustomizeButton

    Thanks for your reply.

    I suppose you mean ON_UPDATE_COMMAND_UI, but for that I need the ID of the control, right? Unfortunately, GetID() returns 0 if I call the button when it's clicked, so I...
  15. Replies
    4
    Views
    732

    CMFCRibbonQuickAccessCustomizeButton

    How to get a pointer to the customize button that belongs to the CMFCRibbonBar in Visual Studio 2010?

    Or, what I really need is to change the tooltip message for the...
  16. Replies
    0
    Views
    767

    Problem with relative paths in VS 2010

    We have migrated to Visual Studio 2010, but have problems with relative paths (that is when selecting a file in Solution Explorer and showing File Properties).

    The problem is when using...
  17. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    I now also tried overriding CDockablePane::IsResizable and return false. Well, it didn't help.

    Please, anyone? Is it really impossible to prevent resizing?? :-/
  18. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    I now created a new MFC project with VS2010 and added just my CDockablePane class. See attached file. You can now see trace for yourself. Please advise.
  19. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    Well, same result...

    CString strRes;
    strRes.Format(_T("%d\n"), res);
    TRACE(strRes);

    It only outputs many rows with "1" when mouse is inside the pane. When hovering mouse over the border or...
  20. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    OK, I see how it's supposed to work. I also read here: http://msdn.microsoft.com/en-us/magazine/cc301402.aspx, where it says "If the mouse is in the left or right border, the default proc returns...
  21. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    OK, here is the relevant code trying to prevent changing the width:

    From class header file:


    public:
    afx_msg void OnWindowPosChanging(LPWINDOWPOS lpWndPos);


    From source file:
  22. Replies
    10
    Views
    2,336

    Re: CDockablePane questions

    Thanks for the suggestion. I tried it now, but I couldn't prevent resizing of the window (though I noticed OnSize is no longer being called if I try to push the original size to...
  23. Replies
    10
    Views
    2,336

    CDockablePane questions

    I'm rebuilding a MFC MDI application with the new extended classes (CMDIFrameWndEx, etc) in Visual Studio 2010. All OK except for some CDialogBars that I have some trouble regarging keeping same...
  24. Replies
    11
    Views
    790

    Re: CArray debug exception

    Thanks again for your informative reply.

    When rewriting to use std::vector instead, I miss the "SetAt" method from CArray. Is there any equivalent with bounds checking in STL to prevent writing to...
  25. Replies
    11
    Views
    790

    Re: CArray debug exception

    First, thanks to Philip for your reply.

    1. The line "std::vector<int> vecFirst = arr.GetAt(0);" is causing the exception.

    2. Agreed, sorry for not using const correctness in this example.
    ...
Results 1 to 25 of 76
Page 1 of 4 1 2 3 4



HTML5 Development Center

Click Here to Expand Forum to Full Width