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

JennyP

@JennyP
About
Posts
73
Topics
37
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Temporal position of pMainFrame->LoadFrame & DialogBar Control Updates...
    J JennyP

    After some more time, I found the issue (loosely related): After deleting a control from my dialog, VC++ assigned the first tab stop to a edit control. I handle the kill-focus message for this edit box and this handler crashes the program because it tries to access the document directly. Therefore, the fix was to change my tab order so that THIS control was not the first. Good lesson, but it took too much time to debug for me. :( :) JennyP

    C / C++ / MFC c++ question announcement

  • Button message - half clicked?
    J JennyP

    I have used the WM_LBUTTONDOWN in this case and then compared the mouse position with the button's rectangle (easily obtained from CButtonCtrl) to see if the user clicked in the button you want. There may be an easier way, but that's one method. JennyP

    C / C++ / MFC question announcement learning

  • Temporal position of pMainFrame->LoadFrame & DialogBar Control Updates...
    J JennyP

    Hello, This is a continuation of my earlier question. I've reposted because I have more information and my previous post was a bit misleading. I found that my application crashes during the "LoadFrame" statement below located in MyApp.cpp. // create main MDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; m_pMainWnd = pMainFrame; It seems that my DialogBar's controls are updating themselves before LoadFrame returns and the next statement executes (m_pMainWnd = pMainFrame). When these controls update, I'm trying to get information from the (MDI) Document to fill them, and the program crashes upon the execution of the following CDialogBar code (because m_pMainWnd is null at the time): CGoalsDoc* pDoc = (CGoalsDoc*)((CMainFrame *)AfxGetApp()->m_pMainWnd)->GetActiveFrame()->GetActiveDocument(); Why are my controls trying to update (e.g., OnKillFocusEditBox1) before the main frame has been created and "m_pMainWnd" has a value? Is there an easy way around this? I don't think I monkeyed with the MFC Wizard too much, but I may have changed something small, yet important. Thanks! JennyP

    C / C++ / MFC c++ question announcement

  • Document not created yet???
    J JennyP

    More clue(s): CWnd *test = AfxGetApp()->m_pMainWnd; gives a null (0) value to test when this statement is inserted just before the statement in my previous message. Therefore, m_pMainWnd has not yet been assigned by MFC..... I'm not sure why this would suddenly stop working. Thanks for reading this so far. :) JennyP

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

  • Document not created yet???
    J JennyP

    Hello, After deleting a control in a DialogBar, using in VC++ 6.0's Dialog Editor, my program crashes upon the following code execution in the DialogBar's class: CGoalsDoc* pDoc = (CGoalsDoc*)((CMainFrame *) AfxGetApp()->m_pMainWnd)->GetActiveFrame()->GetActiveDocument(); The debugger says it's an "unhandled exception". It's as though my DialogBar is looking for a document that's doesn't yet exist yet? How would I go about debugging this issue? Clues: When commenting out the creation of my DialogBar in the CMainFrame class, the program gets further in the execution but crashes when trying to access the CMainFrame->m_DialogBar member. My change that caused this new behavior was the deletion of a CMonthCalendar Control from my DialogBar (and maybe the associated symbol). Any help would be appreciated! Thanks! JennyP

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

  • 'Beep' when calling "TrackPopupMenu"??
    J JennyP

    Thank you for the suggestion. This doesn't seem to solve the issue. The beep occurs (according to debugger) when I call: menu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this); JennyP

    C / C++ / MFC help tutorial question discussion

  • 'Beep' when calling "TrackPopupMenu"??
    J JennyP

    Hello, I respond to a LVN_KEYDOWN event (List View in column mode) and if the user presses enter, I call another function with the following code. When this occurs, there is the audible beep. I don't want the beep. When I call this same code from the OnRButtonDown() (user presses right mouse button) there is no audible beep. I didn't find any documentation in CMenu that would help me determine why there is a beep. My assumption is that the "enter" key is still in some buffer, and the TrackPopupMenu thought it was an invalid selection?? Any thoughts on how to get rid of the beep? menu.CreatePopupMenu(); int levels = GetDocument()->m_nPriorityLevels-1; for (i=levels;i>=0; i--) { menu.AppendMenu(0, IDC_PRI_0+i, GetDocument()->m_sPriority[i]); } menu.TrackPopupMenu(TPM_RIGHTBUTTON, pt.x, pt.y, this); thanks! JennyP

    C / C++ / MFC help tutorial question discussion

  • Directories: renaming, moving, creating
    J JennyP

    Hello, I would like to create a utility that automatically moves MP3 files around and creates directories or deletes them based on my criteria. What is the preferred MFC functions to use for copying, renaming, deleting, and moving both files and directories? ("Directory" is a difficult search word because it results in everything dealing with MFC installation, not directory manipulation). Thanks! JennyP

    C / C++ / MFC question c++ tools

  • Varying CListView Row heights
    J JennyP

    Hello, Is there a way to have CListView (report style) draw rows with varying heights (e.g., one row would have one line of text, the next would have 3, etc.)? If not, what would you suggest as the easiest way to make such a control? Thanks! JennyP

    C / C++ / MFC question

  • Custom Calendar Control
    J JennyP

    Hello, Does anyone know where I can find a visually small calendar control (perhaps similar to the "Palm Desktop" mini calendars) that I could use? I would like to tweak it slightly for a project. It need not respond to mouse-clicks. thanks! JennyP

    C / C++ / MFC question

  • OOD Question: Data / GUI boundary
    J JennyP

    Hello, I'm writing a program that displays a list of tasks on a CListView report. The report view will have varying text color/font & item background colors depending on the context of each specific task (list item). Where should I put the functions to determine these GUI parameters? In the document class or the CListView derived class? Should the document have functions that return the color of each specific list item? Or should the ListView make the determination based on gathering information about the Document tasks/items? I suppose I could throw out the idea of modularity and just treat the GUI and the document as mutually dependent, but I believe that this would be poor design. Does anyone have any pertinent wisdom about how to lay this out? thanks! JennyP

    C / C++ / MFC question design tutorial

  • CListCtrl selection color
    J JennyP

    Hello, Is there a simple way to override the default selection format indication for a CListCtrl---or stop the selection from drawing? The default behavior is for the selected CListCtrl (report) item to be drawn with a dark system color while inversing the text to white. I would like to use an alternative drawing scheme to indicate that the item(s) is selected. I would rather not choose to draw the entire control myself. thanks! JennyP

    C / C++ / MFC graphics question

  • C++ Professional Publications?
    J JennyP

    Hello, I'm interested in expanding my C++ knowledge (OOD, MFC mechanics, etc.) and I would like to get advice on any publications/subscriptions that you folks believe is worth getting. Any ideas? What other resources (books, etc.) do you recommend? Thanks! JennyP

    C / C++ / MFC c++ question

  • Text Extent in CListCtrl (AUTOSIZE)
    J JennyP

    Hello, I'm trying to change my CListCtrl text for each line. With the following code, I've been able to do it successfully. However, when it comes time to AUTOSIZE (GetListCtrl().SetColumnWidth(col, LVSCW_AUTOSIZE_USEHEADER)), it seems to use the system default font to determine how wide to make each column. So to get the widths right, do I have to bite-the-bullet and calculate it all myself? Or is there a way to tell CListCtrl what type of text is in the columns? Thanks! JennyP ...else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage ) { .... CFont newFont; newFont.CreateFont(15,0, 0, 0, FW_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, "Arial"); CDC* pListDC; pListDC = pListDC->FromHandle(pLVCD->nmcd.hdc); pListDC->SelectObject(&newFont); newFont.Detach(); newFont.DeleteObject(); pListDC->SaveDC();

    C / C++ / MFC question

  • Non-Wizard CEdit Control
    J JennyP

    Thanks for the reply... So in my code, the "IDC_EDIT1" would be the 2200 (the control's nID)? m_CEAvailable[i].Create(EditStyle | WS_TABSTOP, CERect, this, 2200+i); JennyP

    C / C++ / MFC c++ data-structures question

  • Non-Wizard CEdit Control
    J JennyP

    Hello, I have created (in code, not the wizard) an array of CEdit boxes. I would like to be notified when the user has clicked in one of these boxes (and which box they clicked in). How would I get MFC to send me a message? thanks! JennyP

    C / C++ / MFC c++ data-structures question

  • CListCtrl: multi line report items, differing fonts
    J JennyP

    Hello, I would like for my report-mode list control to do the following: * Have text-wrapping on one line so that it's taller than a regular one-line item. * Change the font (not just color) of each item and further, each sub-item. Any suggestions or pointers to where to search? I've searched the MSDN somewhat and haven't found anything obvious. Thanks! JennyP

    C / C++ / MFC question

  • GUI/Data Design question
    J JennyP

    Thanks for the response. In my case, its not the graphical device painting that takes time, it's the GUI class calculations that I employ each time the data changes. Unfortunately, the data will change 5 times "at once" causing these calculations to be run 5 times when all I need is one calculation to be done on the last data-change (only after the "last" data change). Thanks! JennyP

    C / C++ / MFC c++ design data-structures help question

  • GUI/Data Design question
    J JennyP

    Hello, I've a document class with an array of records each containing about 15 fields. Currently, I send messages to my GUI to update a record (listview) if that record's fields have been changed (intercepted at documents 'setrecordfield()' function). The problem is that the user can change as many as 5 fields in one GUI operation. This causes my current design to send 5 messages to the GUI to refresh the display--this can become very slow with an increasing number of records/changes (plus, some of my display text items require relatively long functions to compute for each update). I've put some thought in to this but haven't come up with an eloquent design that would only update the GUI when it 'should' (i.e., after the document has stopped changing but not too long after so that the user witnesses delay). I could litter my code with conditional update calls, but that seems like a lot of 'ifs' and would require that I keep changing these places throughout development. I'm not a professional MFC developer, so any hints or approches would be appreciated. Thanks! JennyP

    C / C++ / MFC c++ design data-structures help question

  • CHeaderCtrl messages from CListView based View
    J JennyP

    Hello, I've read the article here about getting header control messages from a CListCtrl. It describes how CHeaderCtrl is in CListCtrl and how to reassign (from the wizard) the dialog item ID to 0 for CHeaderCtrl in rerouting messages. However, my case is slightly different. My main view is derived directly from CListView: class CMyMainView : public CListView ... and in this case, the wizard places ON_NOTIFY_REFLECT macros for all messages. I would like this class to handle some header events (such as click on header button to sort) but I cannot seem to find a way to route the message to where I want. Any help/pointers to resources? Thanks! JennyP

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