CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    13

    Question convert System::String ^ to const BYTE

    I'm performing a simple operation and my brain is not helping me out (overly fried).

    I have:

    String ^ myString = Console::ReadLine();

    I need to convert myString to a const BYTE *lpdata.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: convert System::String ^ to const BYTE

    Use Marshal StringToHGlobalAnsi or StringToHGlobalUni methods.

  3. #3
    Join Date
    Apr 2010
    Posts
    13

    Re: convert System::String ^ to const BYTE

    Thanks Alex.

  4. #4
    Join Date
    May 2010
    Posts
    7

    Re: convert System::String ^ to const BYTE

    Quote Originally Posted by lilrangerabn View Post
    I'm performing a simple operation and my brain is not helping me out (overly fried).

    I have:

    String ^ myString = Console::ReadLine();

    I need to convert myString to a const BYTE *lpdata.
    Use System::Convert::Tostring( );

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

Featured