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
B

bert_r

@bert_r
About
Posts
4
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dump file creation
    B bert_r

    You can tell windows to create these dmp's for you (starting from Windows Server 2008 and Windows Vista SP1). See MSDN for details: Collecting User-Mode Dumps[^]

    C / C++ / MFC help tutorial

  • Chrash at UpdateData(FALSE)
    B bert_r

    I copy-pasted the OnSetValue1 function of a project of mine, and forgot to edit the class name, so CSurveyUpdateDlg::OnSetValue1 should be CThreadDlg::OnSetValue1 And don't forget to add the function prototype in the ThreadDlg.h header file too:

    afx_msg LRESULT OnSetValue1(WPARAM wParam, LPARAM lParam);

    The WMU_SETVALUE1 error is caused by a missing

    #include "Thread.h"

    in the file where you're calling PostMessage(WMU_SETVALUE1, ...) That should do it.

    C / C++ / MFC help c++ data-structures security announcement

  • Chrash at UpdateData(FALSE)
    B bert_r

    You can see I didn't test this ... :sigh: That should have been:

    CWnd * pDlg = (CWnd*)lpParam;

    If that doesn't work, I'll test it myself! :)

    C / C++ / MFC help c++ data-structures security announcement

  • Chrash at UpdateData(FALSE)
    B bert_r

    Try this: the thread function:

    DWORD WINAPI ThreadFunc( LPVOID lpParam )
    {
    CWnd * pDlg = (pDlg*)lpParam;
    int a = 44;
    int b = 45;
    for (int i=40; i<100; i++)
    {
    pDlg->PostMessage(WMU_SETVALUE1, (WPARAM)i,(LPARAM)b);
    Sleep(10);
    }
    return 0;

    }

    in the dialog.h file

    #define WMU_SETVALUE1 (WM_USER+1)

    in the message map add following line:

    ON\_MESSAGE(WMU\_SETVALUE1,OnSetValue1)
    

    And add following function:

    LRESULT CSurveyUpdateDlg::OnSetValue1(WPARAM wParam, LPARAM lParam)
    {
    setValueAlt1((int)wParam, (int)lParam);
    }

    C / C++ / MFC help c++ data-structures security announcement
  • Login

  • Don't have an account? Register

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