Results 1 to 4 of 4

Thread: i am REALLY new to C++ ... help me please??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Posts
    23

    i am REALLY new to C++ ... help me please??

    Okay - I know this will hardly be an lines of code - there is no windows to create or nothing... BUT I can't do it...

    Can someone type me the code to use the SetPixelV and GetPixel API calls in C++ , and also to read what was typed at the command line??

    So I type My.exe -asd -11 -nn

    so I can store those last 3 values in an array?

    Greatly appreciate it

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Posts
    23
    btw, C++ or C, whatever can be compiled with Borland's free BCC compiler

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You can't use SetPixel and GetPixel until you have a device context to draw on

    As for command line arguments:
    Code:
    #include <stdio.h>
    
    int main(int argc, char **argv) {
        // argv[0] = the path to the program
        // argv[argc] is defined by the standard to be NULL.
    
        for(int i = 0; argv[i]; i++) {
            printf("argv[%d] = %s\n", i, argv[i]);
        }
    
        return 0;
    }
    The compiler should do both C and C++. However, be sure what language you want. Files with the extension .cpp will compile as C++, and those with .c will compile as C. Make sure you decide which language you want to use FIRST
    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

  4. #4
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You have to have a window i.e. a DC to use those functions on your window. You can use GetPixel to get the pixel info on other windows' DC's.
    Code:
    COLORREF pi = GetPixel(theDC,Xcoordinate,Ycoordinate);
    ///
    SetPixel(theDC,Xcoordinate,Ycoordinate,RGB(value,value,value));
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

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