Results 1 to 16 of 16

Thread: Visual C++ Question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    I am in the process of learning C++ and I can't seem to figure this out.

    I apologize if this has already been asked, but I couldn't find anything about this using the forum's search feature.

    Anyways I am making a program, it has an explorer style interface, a tree view control on the left and a list view control on the right.

    My question is how do I add/remove items in these controls, I can't seem to figure out how I edit the items in them.

    Any help would be appreciated,
    Thanks

    Damicatz - http://catclub.2y.net (Under Construction)

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    What type of program is it? MFC or API?

    With API you can just use SendMessage to the objects hWnd.
    With MFC the objects should have an add and remove in their classess
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    I think it's MFC, I used the MFC Wizard to create the application.

  4. #4
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    Ok, then did you create your views on a form/dialog?
    If you did then you should attach them to a class, using MFC Class Wizard
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The reason you didn't find much in your search is because this is a C++ forum, not MFC

    Once you've put the controls onto the dialogue using the resource editor, right click on it and choose "Class Wizard".
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    What's the difference between MFC and C++, I am rather new to the whole thing.

  7. #7
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    MFC is kinda like VB (notice I said KINDA), where more things are graphically orientated, lots of functions and things are hidden and its built more around classes and modules. Where C++ (API) you do more things manually.

    Have you done any normal C++ programming?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    I have done a little DOS programming before, with COUT, CIN, etc.

    Will MFC Code work on Macs too? It's a long story but I orginally developed this program in Visual Basic and then the Mac users wanted a Mac version, so I am learning C++ So I can write it in C++ and have someone port it over to the Mac.

  9. #9
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    I am pretty sure that MFC will not work with MACs. I believe that you could manually program something using API to work with MAC, but I have never done that before.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    I looked up porting in the help file. It says I can port it to RISC processors by opening the workspace up on the kind of computer I want to port it to, is this for MFC too?

    Visual C++ for Alpha and PowerPC is designed to be portable between both RISC platforms and Intel platforms. MFC is designed to make C++ code universal on all these platforms, and applications should port easily.

  11. #11
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    I dunno you are a bit out of my league on this. Try posting a new message about C++ and MACs and see if someone else has done this before. Parksie might know this one.
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    I tried using the insert command and now it says "Debug Assertion Failed"

  13. #13
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    This server is too busy is REALLY GETTING OLD

    Any way, you were using the insert command for what?
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    This is the code I used after making a class for it using the class wizard :

    m_TreeLister.InsertItem("Hello World",IDC_MainFrame,IDC_MainFrame,TVI_ROOT,TVI_LAST);

  15. #15
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    What is IDC_MainFrame
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  16. #16

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    Durham, NC
    Posts
    28
    It's an Icon

    I fixed it, It was in the wrong procedure, it was in DoDataExchange, I meant for it to be in the form's OnINIT procedure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width