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
J

JongchanAhn

@JongchanAhn
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why?
    J JongchanAhn

    Dear Cool_Dev Thank you for your help I've solved this problem. Here are what I've done; First of all, It is not nessesary to move the ON_MESSAGE( USER_MESSAGE_2, &CMyWnd::OnMyMessage1HandlerApp ) entry to CMyWnd class's message map. Even though CWinApp derived class is never meant to handle windows messages, We still can hanlde windows messages in CWinApp derived class. How? This is how to get it done. It was simple. Cast the Handler in App class's message map with CWnd::* It should be like this; ON_MESSAGE( USER_MESSAGE_2, (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM))OnMyMessage1HandlerApp ) Cast the Handler with (afx_msg LRESULT(AFX_MSG_CALL CWnd::*)(WPARAM, LPARAM)) Then, problem solved. But I haven't proved the safety of this casting during the application run-time. Well, I compiled and run the application. It seems fine. Nothing odd happened so far with this type casting. Thanks. Chan from SEOUL

    modified on Wednesday, August 11, 2010 3:50 AM

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

  • Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why?
    J JongchanAhn

    The type of the function must be afx_msg LRESULT (CWnd::*)(WPARAM, LPARAM). Which means, Some kind of type casting is needed? I don't follow the details how to fix this problem; Would you be more specific? Thanks in advance Chan

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

  • Can't use 'User-defined-Message' in APP class of dialog-based MFC application. Why?
    J JongchanAhn

    I created a project with VS2008, dialog-based MFC. What I want to do with that project is Sending 'User-defined-Message' in APP Class. So I registered my own message in app class(xxxApp.h) like this: #define USER_MESSAGE_2 (WM_USER+ 102) And, in message map, I added ON_MESSAGE code in app class(xxxApp.cpp) like below: BEGIN_MESSAGE_MAP(CwmUserApp, CWinAppEx) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) ON_MESSAGE( USER_MESSAGE_2, OnMyMessage1HandlerApp ) ... END_MESSAGE_MAP() Also I wrote message handler like this: LRESULT CwmUserApp::OnMyMessage1HandlerApp(WPARAM wParam, LPARAM lParam) { AfxMessageBox(_T("Is it working?")); return 0; } I compiiled. Then one error came up: error C2440: 'static_cast': 'LRESULT (__thiscall CwmUserApp::* )(WPARAM,LPARAM)'에서 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'(으)로 변환할 수 없습니다. Sorry, it's korean. If I translate, it says Can not convert from 'LRESULT (__thiscall CwmUserApp::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' I am not that good with programming, but as much as I understand, Does that say I simply cannot use 'User-defined-Message' in APP class? 'User-defined-Message' in dlg class or view class works fine with me though. Thanks in advance :) chan

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

  • What is best way to convert desktop app to web app?
    J JongchanAhn

    The discussion is now going beyond the original subject( best way to convert desktop app to web app)... So, The bottom line (about original subject) is "We haven't been there yet!" Is that right? :) I think Webmatrix is good to apply. Not sure that it's sufficent to apply.

    Windows Forms question csharp wcf design collaboration
  • Login

  • Don't have an account? Register

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