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
M

Member 868926

@Member 868926
About
Posts
14
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error deleting first column in CListCtrl
    M Member 868926

    Victor Nijegorodov wrote:

    Just for a test: what will happen if you call

    mCSVListCtrl.DeleteColumn(0);

    from anywhere but from this MyClass::OnLvnColumnclickList(...) message handler?

    It's the same. I think I'll have to go for the dummy left column idea some of you have suggested - maybe I'll use it to number the rows which might be quite nice anyway. Thanks again for all your replies.

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

  • Error deleting first column in CListCtrl
    M Member 868926

    Thanks for the various replies. The debugger doesn't go beyond DeleteColumn() but I can see it's passing zero. Can you see anything odd about the way I'm creating my sub items that could be causing the problem? I've created the columns first then for each item (row) I'm adding subitems left to right. Otherwise I'll have to go for the dummy first column option.

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

  • Error deleting first column in CListCtrl
    M Member 868926

    Hi, I am generating a CListCtrl in Report view (MFC). It loads fine and I can reorder columns by dragging the headers. I've made it so clicking a column header deletes the column - again this works fine except for the first (leftmost) column. Here the header is deleted but the data underneath doesn't change - in fact the data from the last column is deleted: Before:

    Header1 Header2 Header3

    Data1 Data2 Data3

    After trying to delete first column:

    Header2 Header3

    Data1 Data2

    Having created the columns to begin with, I'm setting up the rest of the table like this:

    void MyClass::InsertItem(int x, int y, CString &str)
    {

    LVITEM lvi;
    lvi.mask = LVIF\_TEXT;
    lvi.iItem = y;
    lvi.iSubItem = x;
    lvi.pszText = (LPTSTR)(LPCTSTR)(str);
    int result;
    if(x == 0)    {
        result = mCSVListCtrl.InsertItem(&lvi); 
    }
    else {
        result = mCSVListCtrl.SetItem(&lvi); 
    }
    

    }

    which seems to create the table OK. Then when a header is clicked:

    void MyClass::OnLvnColumnclickList(NMHDR *pNMHDR, LRESULT *pResult)
    {
    LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR);

    mCSVListCtrl.DeleteColumn(pNMLV->iSubItem);// This IS getting zero
    
    \*pResult = 0;
    

    }

    Any ideas?

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

  • Google contacts from Visual Studio 2008 C++ desktop application
    M Member 868926

    Hi I'm at my wit's end trying to access a user's Google contacts from my Visual Studio 2008 C++ desktop application. It's all set up with Google and I can run a php script online using Curl to get exactly what I need. So I thought I'd access that web page from my program using CInternetSession but then I can't get the redirected page after it's authorised. Then I thought I'd try intalling curl to use with VS but that's a nightmare. I might be able to use c# functions but I haven't learnt that yet, and am not sure how I can mix that with C++ (I think it can be done but my overall understanding of programming would make it very hard). Can anyone suggest what my best route would be? Many thanks for your time Greg Chapman

    C / C++ / MFC csharp visual-studio c++ php tools

  • Problem loading non-default wab
    M Member 868926

    I'm not sure - in the header file I can't see another version except WabOpenEx which I tried but didn't work. I've noticed that my Contacts folder is actually receiving the wab addresses and getting bigger and bigger! So instead of opening the wab on its own it's adding them to the Contacts then opening those instead. Is this some undocumented Vista mechanism? Thanks very much for everyone's conttributions so far. G

    C / C++ / MFC help

  • Problem loading non-default wab
    M Member 868926

    I tried that, then it just doesn't load anything.

    C / C++ / MFC help

  • Problem loading non-default wab
    M Member 868926

    Yes the wab is OK. If you doubleclick it Windows asks if you want to import the addresses. Somehow the WabOpen bit just thinks I want the default Wab (although there isn't one in Vista) and isn't getting the filename. In the original code there was a 'GetNativePath()' call which isn't available - could it be to do with how I'm passing in the file location string? G

    C / C++ / MFC help

  • Problem loading non-default wab
    M Member 868926

    It doesn't return an error, just loads my Vista Contacts instead. Compatability seems OK.

    C / C++ / MFC help

  • Problem loading non-default wab
    M Member 868926

    Good point, well I'm now trying: wp.szFileName = "C:\\Jim.wab"; as I know that wab exists there but it still isn't loading it. G

    C / C++ / MFC help

  • Problem loading non-default wab
    M Member 868926

    Hi I'm having trouble trying to load a non-default .wab file (I know it's old hat but need to keep it going for my XP users). I'm running it on Vista and although I'm supplying a filename it keeps loading my Vista Contacts instead instead of the specific wab addresses. It must be going wrong around here (mostly stock code from the msdn sample code): // (pszFileName is const char *) if(m_hinstWAB) { // if we loaded the dll, get the entry point // m_lpfnWABOpen = (LPWABOPEN) GetProcAddress(m_hinstWAB, "WABOpen"); if(m_lpfnWABOpen) { HRESULT hr = E_FAIL; WAB_PARAM wp = {0}; wp.cbSize = sizeof(WAB_PARAM); wp.szFileName = (LPTSTR) (LPCTSTR) pszFileName; // if we choose not to pass in a WAB_PARAM object, // the default WAB file will be opened up // if(m_lpfnWABOpen(&m_lpAdrBook,&m_lpWABObject,&wp,0)==S_OK) m_bInitialized = TRUE; } As usual, any help much appreciated. Greg

    C / C++ / MFC help

  • Problems with other people's Vista!
    M Member 868926

    I finally worked it out. You were right about access priveleges etc. On quitting my app would try and update a data file in the app's own program folder - hence the error (unless the folder's priveleges had been manually changed, or UAC turned off). I turned off UAC within about 5 minutes off getting Vista, so didn't realise what was happening. Doesn't this make developing software for Vista a lot more complicated? Is Windows 7 the same? Thanks again GC

    C / C++ / MFC c++ help

  • Problems with other people's Vista!
    M Member 868926

    Thanks for your replies. It would be a shame if I had to include the distributable package - I think it would put me off installing a little shareware app; and most things work OK. I'll try and explore the access rights idea - but it's hard to find bugs when they don't occur on the development machine! Cheers Greg

    C / C++ / MFC c++ help

  • Problems with other people's Vista!
    M Member 868926

    Hi I have an application that runs fine in XP, and also in Vista on my laptop. However users are reporting problems in Vista, particularly concerning saving files and this message when they quit the programme: "This application has requested the Runtime to terminate in an unusual way" I presume this is something to do with me having installed Visual C++ 2008 on the laptop, so I have certain libraries or files that other users don't. I know this is a bit vague, but I thought someone might recognise the problem. Thanks in advance if you can help. Greg Chapman

    C / C++ / MFC c++ help

  • How do I check syntax in Visual Studio 2008?
    M Member 868926

    I used to be able to do this in my earlier version but can't work out how to do it now. It was a quick and useful way to check the syntax of an individual file was OK before compiling. Thanks Greg

    C / C++ / MFC question csharp visual-studio tutorial 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