.NET C++ Trouble adding to listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Xeifrank
    New Member
    • Jul 2006
    • 3

    .NET C++ Trouble adding to listbox

    I'm a .NET newbie I will admit it. I have moderate experience in VB6 and am a decent C programmer. I recently got ahold of Visual Studio .NET and was asked to write a project using C++ .NET I created a simple ListBox and tried to add an item to it on the fly and I get a compile error about unmanaged vs managed arguments. My code is simple.

    this->ListBox1->Items->Add("Hello") ;

    this gives me the error. If I replace the "Hello" text with text from a textbox then it works fine, but this is not what I want to do. Any suggestions? I have also tried to prefix the argument in the Add method with an 'L' which also did not work. Thanks.

    vr, Xei
  • Xeifrank
    New Member
    • Jul 2006
    • 3

    #2
    Anyone have an input on this one??

    Comment

    • Xeifrank
      New Member
      • Jul 2006
      • 3

      #3
      Is this thing on?

      Comment

      • Enyi
        New Member
        • Jul 2006
        • 38

        #4
        lol, yeah its on.

        I've tried doing what your trying to do myself, only to get some error and its working with textbox, but not strings of any kind.

        But then again, I don't know much C++.

        Someone must know...anyone?

        Comment

        • Enyi
          New Member
          • Jul 2006
          • 38

          #5
          lol, just googled around a bit and I think I found something:



          The example somewhere on this page preceds the string with a capital 'S', worked for me :P

          Comment

          Working...