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
S

souldog

@souldog
About
Posts
11
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • what is difference betwn pointer and referece
    S souldog

    Well what I meant was void FOO(int* p){*p+=1;} int* i = NULL; FOO(i) If you use references then this sort of problem just can not occur. So it is not that an error will be caught at compile time, there can be no error if you use references. Anyway replacing pointers with references is not always feasible, if the concept of null object is valid, or if the pointer must be rebound (references cannot.) I agree and that is what I said.

    C / C++ / MFC question

  • what is difference betwn pointer and referece
    S souldog

    I would say it is not a matter of style and convenience. In most circumstances only pass pointers into functions if you need the possibility that the object is not valid, i.e. null pointer. It is a matter of the compiler catching errors or having them show up at runtime.

    C / C++ / MFC question

  • what is difference betwn pointer and referece
    S souldog

    Really? try compilling these const int* p = NULL; and int& l = NULL;

    C / C++ / MFC question

  • Switching Between View in MDI
    S souldog

    Well have a look at CMDIFrameWnd::MDIActivate

    C / C++ / MFC

  • How do you use MM_ISOTROPIC mode with a CScrollView?
    S souldog

    You are not supposed to use MM_ISOTROPIC with scroll views. The Scroll view has a function SetScaleToFitSize which will scale the view to the window size.

    C / C++ / MFC help question

  • height of the header of window
    S souldog

    You are not giving enough information. I will assume that you have a window and you want to fill its client area with another window. Use GetClientRect() to get the client area. You are probably using GetWindowRect()

    C / C++ / MFC question tutorial

  • docking a modeless dialog
    S souldog

    What you want is called a dialog bar. Take a look at CDialogBar or look at this http://codeguru.earthweb.com/docking/devstudio_like_controlbar_2.shtml[^]

    C / C++ / MFC tutorial question

  • vector and delete
    S souldog

    No, No, No.. Don't do this. Do not store the pointer returned by new anywhere else except the vector. All access to that object should be through the pointer stored in the vector. Your problem here is that you have many copies of the pointers floating around. You need to redesign your application so that this is not the case. if the code is inside the class pointed to then it should not be possible to call it in any other way except through the pointer stored in the vector, so you don't need to check it for NULL This is how it should be done. ANy other way and you have Code that is very hard to maintain and very error prone. Can you explain why and how you are possibly calling a function in a class the instantiation of has just been deleted from memory.

    C / C++ / MFC graphics question

  • Class Problem?
    S souldog

    Not this way. You have created the object on the stack in the first function and so the object is destroyed when the function returns. Therefore, your pointer to this object is no longer valid outside the scope of the first function. There are lots of ways to approach this problem, but one is to return an object of type A by value from the first function and assign it to another object of type A which is declared outside the function. The best method depends on the cost of creating and assigning the object.

    C / C++ / MFC c++ help question

  • map erase issue
    S souldog

    By the way, if you want to make the map empty then just call clear()

    ATL / WTL / STL help tutorial question

  • Dialog
    S souldog

    I will answer 1. Handle OnNcHitTest and tell the system the mouse click was on the client area when it is actual hit on the caption. Here is the code UINT CMyDlg::OnNcHitTest(CPoint point) { UINT ret = CDialog::OnNcHitTest(point); if(ret == HTCAPTION ) return HTCLIENT; else return ret; }

    C / C++ / MFC c++
  • Login

  • Don't have an account? Register

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