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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
F

fitatc

@fitatc
About
Posts
28
Topics
13
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • A pointer of variable or a function?
    F fitatc

    This makes sense. Thank you very much :)

    C / C++ / MFC data-structures question

  • A pointer of variable or a function?
    F fitatc

    shouldn't a function pointer's size be 4? how can a sizeof(*funcPtrArray(param)) turn out to be some relation with ReturnValTypeSize

    modified on Sunday, January 31, 2010 9:20 PM

    C / C++ / MFC data-structures question

  • A pointer of variable or a function?
    F fitatc

    There is a macro _countof, the define is

    template <typename _CountofType, size_t _SizeOfArray>
    char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
    #define _countof(_Array) sizeof(*__countof_helper(_Array))

    It confuse me that __countof_helper is a very weird pointer. At first glance, I thought it is a pointer of array, but, how can an variable can have an "()" suffix???

    C / C++ / MFC data-structures question

  • Why CDC::LineTo(pt) draw a line not include pt
    F fitatc

    Thank you very much.

    Richard MacCutchan wrote:

    Try one of the Microsoft forums. How important is it to you to know?

    To my work, not a bit. To mySelf, I am kind of serious man, ;P

    C / C++ / MFC question

  • Why CDC::LineTo(pt) draw a line not include pt
    F fitatc

    thanks, you said ask microsoft. do you mean I should post this to MSDN forum? or just mail to someone?

    C / C++ / MFC question

  • Why CDC::LineTo(pt) draw a line not include pt
    F fitatc

    By MSDN, that CDC::LineTo(pt) will draw a line to, but not include the specified "pt". Why is that? any special purpose?:confused:

    C / C++ / MFC question

  • CScrollView crash when start in MAXIMIZE
    F fitatc

    thanks you, but this video does not show the crash case and how to fix it....... :(

    C / C++ / MFC c++ question

  • CScrollView crash when start in MAXIMIZE
    F fitatc

    I have not add any of my code to the MFC SDI project. 1. I start SDI by wizard in VS2008. Change CView's base class to CScrollView. 2. Rebulid my project and test it, maximize the window, close it and start it again, It crashed!!!:confused: Any one knows the different between start in normal and in maximize?

    C / C++ / MFC c++ question

  • button(visible&Enable) but CANNOT be pressed
    F fitatc

    thanks, Eric Haddan I use Button just to show the problem, it will be the same if two dialog created as child of CTestView The problem is: because sibling window paint in z-order(not as MSDN said), window in the lower order paint latter,makes window showed, but not active.

    C / C++ / MFC c++ help visual-studio com json

  • button(visible&Enable) but CANNOT be pressed
    F fitatc

    :confused:My qustion is Why this happened??? if sibling window paint by Z-order according to MSDN doc, the button should not be painted after the dialog. http://msdn.microsoft.com/en-us/library/dd183426(VS.85).aspx[^] -------------------------------------------------------------- Do the follow simple step you will see the "magic" button: 1. Create MFC SDI project 2. At [resouce view], Add a dialog and set style child.(WS_CHILD) 3. Add this code to the *view.cpp to create to child window:

        #define BTN1 10101
        int CTestView::OnCreate(LPCREATESTRUCT lpCreateStruct)
        {
         if (CView::OnCreate(lpCreateStruct) == -1)
          return -1;
    
         // TODO:  ここに特定な作成コードを追加してください。
          m\_dlg.Create(CTestDlg::IDD, this);
         m\_dlg.ShowWindow(SW\_SHOW);
         RECT rect;
         rect.left = 10;
         rect.top = 100;
         rect.right = 110;
         rect.bottom = 125;
         m\_btn.Create(\_T("testBtn"), WS\_VISIBLE | BS\_PUSHBUTTON, rect, this, BTN1);
         return 0;
        }
    
       \* CTestDlg m\_dlg, CButton m\_btn is member of the CTestView
       \* Z-order can be checked either by Spy++ or GetWindow API
    

    You can fix the problem by add WS_CLIPSIBLINGS style of the button.

    m_btn.Create(_T("testBtn"), WS_VISIBLE | BS_PUSHBUTTON | WS_CLIPSIBLINGS, rect, this, BTN1);

    C / C++ / MFC c++ help visual-studio com json

  • Can I destory other thread's child window?
    F fitatc

    I know that sending WM_CLOSE or WM_DESTROY or WM_QUIT can destory a window created by other thread. But this is not working when the target window is child window(With WS_CHILD Style, like property window in SDI). [My Question is] Can I destory other thread's child window? If I can, please give me some advise about how to do it.

    C / C++ / MFC question tutorial

  • ATL Services Cannot start?
    F fitatc

    I am new in ATL at all. First time try to learn ATL this morning(in japan) that turn out to be a bad experience. Following the Wizard I created a ATL Service Project, install it as a service.(using vs2008) And I cannot beleve that SCM cannot start the service.!!!!:mad: Thanks to the codeproject, I found the answer by two message in 2002 [Message1:]http://www.codeproject.com/Messages/127680/Problem-with-ATL-7-0-Service.aspx?bmkres=success[^] [Message2:]http://www.codeproject.com/Messages/130324/I-found-2-issues-in-ATL-7-0-Service-projects-Should-I-put-this-somewhere-here.aspx?bmkres=success[^] It is been 7 years past, what wrong with the ATL? 1. What is the simplest way to run a service? create a com object?(a ref would be appriciated) 2. If Message1 is right, why microsoft did not fix it?

    ATL / WTL / STL help question c++ com

  • (NULL == p) vs (p == NULL)
    F fitatc

    what different between (NULL == p) and (p == NULL) I realy confused about this, Any advise will be help.

    C / C++ / MFC visual-studio help

  • Does anyone know about "MSUIM.Msg.Private"?
    F fitatc

    I can't find any refrence any where(like this website, google, wiki). :( -----------------How I found it------------------------------------------- It's a Window's string message(0xC000 through 0xFFFF). I got this from my [MFC Dialogbased Program]: create a new [MFC Dialogbased Program], put a breakpoint here: thrdcore.cpp

    BOOL AFXAPI AfxInternalPumpMessage()
    {
    _AFX_THREAD_STATE *pState = AfxGetThreadState();

    if (!::GetMessage(&(pState->m\_msgCur), NULL, NULL, NULL)) //●
    

    Do nothing but start you program, you will get a message over 0xC000. Use spy++ or GetClipboardFormatName you will get "MSUIM.Msg.*" //* may be Private

    C / C++ / MFC c++ debugging question

  • How to cancel long time drawing
    F fitatc

    Sorry for my late response,(I am in a busy work now) You are right, but before that, :confused:Do you think it is OK to draw in the work thread? I mean, a good design? because drawing is touching the GUI I thought, maybe I was wrong.

    C / C++ / MFC c++ graphics tutorial

  • How to cancel long time drawing
    F fitatc

    May be You misunderstanding my qustion because of my poor english. My Question is "How to do multiThread thing in one GUI thread." in another word. But by your advise, I did find the answer from old Qustions By another guy: http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=570370[^]

    C / C++ / MFC c++ graphics tutorial

  • How to add Event handler to dynamically created Button
    F fitatc

    I think you can use CMyButton instead of CButton:

    class CMyButton: public CButton{
    };

    you can add Event handler(massage handler) to this class.

    C / C++ / MFC tutorial

  • How to cancel long time drawing
    F fitatc

    I am writing a code to do a long time draw like:

    void MyDialog::DoSlowDraw(DWORD tDelay){
    while(notFinished){
    DrawNextLine(); // like LineTo()....
    Sleep(tDelay);
    }
    }

    And it's better to have a "cancel button" because it may take a long time according to tDelay. --------------------- :(( My try: To handle "cancle button clicked Message" , Drawing must be done by another thread.

    UINT DrawProc( LPVOID pParam )
    {
    CMyDialog* pform = (CMyDialog*)pParam;
    int timeDelay = pform->timeD;
    Line_list* pLines = pform->m_pLines;
    CClientDC cdc(pform);
    //Draw....

    It's worked, but as far as I know 1. Work thread should not touch the GUI ---- (Do the drawing). 2. MFC object should not passed to another thread ---- (passing drawing data by CMyDialog*) :confused:Is there a good way to cancle long time drawing.

    C / C++ / MFC c++ graphics tutorial

  • if(BOOL_b) vs if(BOOL_b == FALSE)
    F fitatc

    BOOL b
    A. if(!b){ ... }
    B. if(b == FALSE){ ... }

    There is my senior who says that B is better though said by another senior that a is better, too. Both could not exactly explain the resion.:~ Also, sample by MSDN like PtInRect's, is test by if(b). And I checked the assembly of A and B, they are the same. :confused: Which is better in your opinion, A or B? Is it really different only in oppearance?

    C / C++ / MFC visual-studio question

  • Window Handle from CreateWindow will colse itself when thread exit?
    F fitatc

    Thank you very much, that just the answer what I need!!! :-D :-D

    C / C++ / MFC debugging help 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