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
H

hiseldl

@hiseldl
About
Posts
16
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • list ctrl help-- if new item selected, validate old, and keep old if validation fails
    H hiseldl

    I have a CListCtrl in a CFormView that represents objects. In the form view I have controls that represent data of the selected object. When a new object is selected in the list, I need to: 1. validate the data 2. if the data is not valid, keep the original list item selected, and do not select the new item. 3. if the data is valid, then show the data of the new object. I have added OnItemchangingX and OnItemchangedX for the list control to my form view class.

    void CAddonView::OnItemchangingX(NMHDR* pNMHDR, LRESULT* pResult)
    {
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
    BOOL bValidateSuccessful = validate();

    if (!bValidateSuccessful) {
    
    --------------------------------------------------
    ...what do I do here to keep the old item selected
    ...and keep the new one from getting selected?
    --------------------------------------------------
    
    }
    

    }

    void CAddonView::OnItemchangedX(NMHDR* pNMHDR, LRESULT* pResult)
    {
    NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
    int iSelItem = m_listAP.GetNextItem(-1, LVNI_ALL | LVNI_SELECTED);
    if (iSelItem != -1 && pNMListView->uNewState & LVIS_SELECTED)
    {
    ...load data of newly selected item...
    }
    }

    What do I need to do to keep the old selection if the validation fails? Thanks. -- David Hisel Internet Business Software

    C / C++ / MFC com business help question

  • MFC and std namespace-beginner question
    H hiseldl

    Try: #include <cmath> using namespace std; ... // use the sqrt func float x = sqrt(y); or you can just call the sqrt function without the "using" keyword: #include <cmath> ... // use the sqrt func float x = std::sqrt(y); HTH. David Hisel -- http://www.hisel.com/

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

  • DialogBar to View communication question
    H hiseldl

    Nope, it doesn't seem to work. Here is what I have: void CMainFrame::OnBtn() { CMyView* pView = (CMyView*)GetActiveView(); if (pView) pView->OnViewBtn(); } pView is NULL every time I press the button, hence, no call to OnViewBtn(). Is there a way to send a message to the view class? Would that work? David Hisel -- http://www.hisel.com/

    C / C++ / MFC question c++ com debugging learning

  • DialogBar to View communication question
    H hiseldl

    I'm using VC6, and created an MFC app through the app wizard selecting the Internet Explorer ReBars option. This puts a CDialogBar in the CMainFrame class. Using the resource editor I added an Edit control and a button to the dialogbar, named IDC_EDIT and IDC_BTN. I added a command message through the class wizard that maps the button to an OnBtn method in CMainFrame. I put a breakpoint in the method, and when I press the button, the app stops at the breakpoint. So, how do I call CMyView::OnViewBtn() in my view class from the CMainFrame::OnBtn() method? Thanks. David Hisel -- http://www.hisel.com/

    C / C++ / MFC question c++ com debugging learning

  • Adding a data source question
    H hiseldl

    This is great! Thank you. Note: your code was mis-interpreted as HTML inside the first if block, look at the for loop to see what happened. Could you send this via email to david at hisel dot com? Thanks again, David Hisel -- http://www.hisel.com/

    C / C++ / MFC question c++ com help tutorial

  • Adding a data source question
    H hiseldl

    Thanks! This is very helpful, I appreciate it. :) David Hisel -- http://www.hisel.com/

    C / C++ / MFC question c++ com help tutorial

  • Adding a data source question
    H hiseldl

    I've searched the code project site, but I have been unable to find any articles that show how to add a system dsn through code. Could someone point me to a snippet of C++ that registers a DSN in the ODBC Data Sources? I appreciate any help you can give me. :) David Hisel -- http://www.hisel.com/

    C / C++ / MFC question c++ com help tutorial

  • VStudio setting to see macro expansion?
    H hiseldl

    the Property Pages, do you mean Project->Settings from the main menu? Also, I am using VStudio 6 Enterprise Edition, if that helps. .dave. David Hisel -- http://www.hisel.com/

    C / C++ / MFC com question

  • VStudio setting to see macro expansion?
    H hiseldl

    I wrote a #define macro and I would like to see the output after it's preprocessed, is there a setting in VStudio that would show the macro after it is expanded? .dave. David Hisel -- http://www.hisel.com/

    C / C++ / MFC com question

  • Anyone have a pointer to win32 api example?
    H hiseldl

    What if I'm just lounging? :) David Hisel -- http://www.hisel.com/

    The Lounge c++ com json tutorial question

  • Broadband and firewall
    H hiseldl

    I use sygate personal firewall. It integrates with their network sharing software. I've been using it for about 6 months with no complaints. http://soho.sygate.com/free/default.php .dave. David Hisel -- http://www.hisel.com/

    The Lounge question

  • Anyone have a pointer to win32 api example?
    H hiseldl

    I need an example of adding a child window to a win32 app with an edit control in it. I've searched a bit on MSDN and CP, but I seem to find only MFC examples. I used the VStudio wizard to create a win32 app and have started hacking on it. In my hacking endeaver I discovered that MFC really hides a lot of the details of the win32 api. All pointers are appreciated. .dave. David Hisel -- http://www.hisel.com/

    The Lounge c++ com json tutorial question

  • Is there an app that can watch the registry?
    H hiseldl

    Thanks Todd! :) David Hisel -- http://www.hisel.com/

    The Lounge c++ com windows-admin help question

  • Is there an app that can watch the registry?
    H hiseldl

    I have an application that *should* run in win2k, but it doesn't; It runs just fine in win9x. I suspect that it sets an entry in the registry and that it reads that entry every time it starts up. Is there a way to watch the registry for "reads" and "writes"? An app would be nice, if someone could point me to some C++ code, I can also write an app to hook into the system DLL's to watch. All help is greatly appreciated. :) .dave. David Hisel -- http://www.hisel.com/

    The Lounge c++ com windows-admin help question

  • What is Sonork?
    H hiseldl

    Besides being Kronos spelled backwards (yeah, the klingon home world), what can I use it for? .dave. David Hisel -- http://www.hisel.com/

    The Lounge question com

  • E-mail Hell... The following recipient(s) could not be reached
    H hiseldl

    I can't stand the "POP first" policy of my email host... so, I installed my own SMTP server... http://www.postcastserver.com/ ...the best part is, it's free! This is a good solution if your on a windows box. cheers, .dave. David Hisel -- http://www.hisel.com/

    The Lounge com sysadmin 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