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
P

prateekkathuria

@prateekkathuria
About
Posts
21
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • adding bitmap to a cbutton
    P prateekkathuria

    sorry ravi, it was a scoping issue but i am still not clear why. the CBitmap bmp; is required to be a class level member. I was assuming that when we call a setbitmap on the button and pass a HBITMAP to it, a copy should be sent and there should be no scoping issue.

    C / C++ / MFC graphics question learning

  • adding bitmap to a cbutton
    P prateekkathuria

    setbitmap takes an object so i dont think that could be a reason. But may be its worth trying.

    C / C++ / MFC graphics question learning

  • adding bitmap to a cbutton
    P prateekkathuria

    thats a subclass and thats what i dont wanna do. I also tried adding the style BS_BITMAP thru the setwindowlong just to makesure the style was being set but no luck.....

    C / C++ / MFC graphics question learning

  • adding bitmap to a cbutton
    P prateekkathuria

    I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have. CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID); CBitmap bmp; bmp.LoadBitmap(BITMAP_ID); HBITMAP hBmp = HBITMAP(bmp); pButton->SetBitmap(hBmp); the bitmap doesnt appear any suggestions? What am i doing wrong??? Thanks in advance

    C / C++ / MFC graphics question learning

  • windows ce and pocketpc 2003
    P prateekkathuria

    I am trying to capture the event that happens on holding the stylus at a point on the screen i tried doing what i want to do in the handler of NM_RECOGNIZEGESTURE but that doesnt work. Any sugesstions.

    C / C++ / MFC

  • message reflection
    P prateekkathuria

    got rid of the compilation error need to use ON_COMMAND_REFLECT_EX. So now my code compiles and runs but the handler of the parent is not invoked why?? although i do have an onButtonClick in the parent.

    C / C++ / MFC help c++ regex

  • message reflection
    P prateekkathuria

    I am using message reflection in myButton class so what i have in the message map is as below: BEGIN_MESSAGE_MAP(myButton, CButton) ON_CONTROL_REFLECT(BN_CLICKED, onButtonClick) END_MESSAGE_MAP() the prototype for onButtonClick() is afx_msg void onButtonClick() and this works well. But i do want the parent as well to be notified so as mentioned in the MFC doc i modified the onButtonClick to return BOOL so it is then afx_msg BOOL onButtonClick() But this gives a compile time error : error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall aegis::myButton::* )(void)' to 'AFX_PMSG' None of the functions with this name in scope match the target type. Any suggestions or is it a yet another bug in mfc. thanks

    C / C++ / MFC help c++ regex

  • images in different columns in a listctrl
    P prateekkathuria

    hi, I want the list control to be able to have images in differnt columns( could be any column 0,1,2..) so i create a CIMAGELIST from some resource and also set it for the list control by calling the method m_listCtrl->SetImageList(&m_imagelistsmall, LVSIL_SMALL); What this does is set the images from the imagelist in column1( always). even when i dont specify the LVIF_IMAGE mask when adding item. I dont want the image in the first column. Also what do i do to have the image in other other columns

    C / C++ / MFC learning

  • delegating events from child to parent
    P prateekkathuria

    Hi, I have a dilaog box(parent) which has a tab control whose tabs are implemented as dialog boxes(children). Each tab has some controls say a button on tab1. I want to delegate the events cretaed by controls on various tabs to the parent dialog. How can i do that. Is there a macro just like reflection macros? we know that control events will be handled by their parent that is my child dialog instead i want them to passed down the hierarchy to the parent dialog. thanks

    C / C++ / MFC question

  • ctabctrl
    P prateekkathuria

    i am successfully able to create the tabcontrol using the cdialog extended class as tabs. what is the difference in "can do and cannot do" if a property sheet is used instead? Which of the two is better to use and why?

    C / C++ / MFC

  • ctabctrl
    P prateekkathuria

    i want to dynamically create a tabctrl and add tabs dynamically to it. Also teh controls rendered on each tab will be dynamically created. Any suggestion of how it can be achieved.

    C / C++ / MFC

  • overriding wndproc WM_NOTIFY
    P prateekkathuria

    i am overriding wndproc an handling the wm_command and wm_notify message appropriately. in the case statement of wm_notify this is what i have case WM_NOTIFY: nmhdr = (NMHDR*) lParam; notificationId = nmhdr->code; if(notificationId == NM_CLICK) { AfxMessageBox(_T("CLICKED")); return FALSE; } else if(notificationId == NM_DBLCLK) { AfxMessageBox(_T("double CLICKED")); return FALSE; } ... .... //more if else goes here else { // call default } the flow does enter this switch statement but never invokes the appropriate handler. When i tried to get the value of the notificationId it shows some junk value though nmhdr is properly initialzed and the controlid that generated the message is correct. what am i missing? thanks

    C / C++ / MFC question

  • common controls on windows ce
    P prateekkathuria

    I am trying to create some common controls on windows ce. This is what i am doing. m_tooltip= new CToolTipCtrl(); m_tooltip->Create(this); m_tooltip->AddTool(button1,"Test Button"); m_tooltip->Activate(TRUE); this is a code snippet from OnInitDialog(). Ihave included the headers afxcmn.h and commctrl.h but i still get the following compile time errors. Anything else i need to include error C2512: 'CToolTipCtrl' : no appropriate default constructor available error C2027: use of undefined type 'CToolTipCtrl'd:\Program Files\Windows CE Tools\wce420\STANDARDSDK_420\mfc\include\afxstat_.h(337) : see declaration of 'CToolTipCtrl' and more all related to the common controls. thanks,

    C / C++ / MFC c++ tools help

  • pretranslatemessageoverride
    P prateekkathuria

    thanks a lot. Your explanation solved it all. Is this behaviour of getMessage and pretranslate/translate message documented somewhere in msdn so that i could dig more into it.

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    Correct, but assume that the controls on the dialog are dynamically created such that at time of coding i dont know as to what are the controls on the dialog. So i cannot provide the macro ON_BN_CLIKCED(btnid, handler). The reason i want to over ride the pretranslatemessage is to catch what ever goes thru the message loop filter the messages i am intersted in by using and ifelse construct like you mentioned. But the main question is my handler in pretranslate never gets invoked Why??? Cmydialog::PreTranslateMessage(MSG *msg) { if( pMsg->message == WM_COMMAND ) { if(LOWORD(pMsg->wParam)==IDC_CTRL_ID && HIWORD(pMsg->wParam)==BN_CLICKED) { UINT controlID = LOWORD(pMsg->wParam); if (controlID == someidofinterest) { //do what i want it to do } } } }

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    I dont wanna go subclass way because i dont wanna subclass "n" classes. Since my ui may have n differnt controls.

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    i tried notify but no change. I cannot handle it still.

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    "You can process the message in the parent window. The only thing you have to do is map a message handler to the desired action in your windows message map: BEGIN_MESSAGE_MAPE(YourWindow, DerivedFrom) ON_BN_CLICKED(IDD_YOUR_BUTTON_ID, memberfxn) END_MESSAGE_MAP() " That is correct but my requirement is slightly different. I dont want to provide a static macro like the one above. Because my application reads what controls are to be rendered from datastructure. It reads from the datastructure that it need to create a button with xyz style , a textbox with some wdth and style etc. Now i cannot use static statemenst as above. So what i wanted to do was intercept the default message handling mechanism. I wanted to override the pretranslate message for this and then from the MSG structure get what was the event fired and who fired it process it in pretranslatemessage and return.

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    it could be a bn_clicked, en_change, cbn_selchanged any message( command or notification ). I donot agree that BN_CLIcKED is a wm_notify type because CButton is a standard control and not a common control.

    C / C++ / MFC question

  • pretranslatemessageoverride
    P prateekkathuria

    thanks for the answer. But this is what i understand about the message handling mechanism of MFC. When a control say a button is clicked it invokes its own wndproc which does what ever is required( say showing it in depressed state). Thiis because every control is actually a window.And then it sends anotification to the parent WM_COMMAND( in this case with msg as BN_CLICKED). Right? If this was the case then i Should be able to handle BN_CLICKED in parent. Please correct me if i am wrong.

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