Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Problem on reading the command line

  1. #1
    Guest

    Problem on reading the command line

    Hello all, I am a beginner to win32 programming and OpenGL.
    Now having a problem about reading the command line, hope anyone would help.

    I am writing a win32 program that reads a file on the command line.
    The file contains vertex informations to draw with OpenGL.

    int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
    {

    Let's say my program is named "draw.exe" and I'd like to read the file "data.txt".
    So I run "draw.exe data.txt".

    How can I make the lpCmdLine becomes a character string? so that I can manipulate it with simple C++ commands?
    fopen(lpCmdLine, "r") fails to work.

    or is there a way that I can convert the data type LPSTR to char string?

    Thanks a lot!

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Problem on reading the command line

    It is already string.

  3. #3
    Guest

    Re: Problem on reading the command line

    Thanks a lot!

    I have figured it out already now!

Posting Permissions

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