WinApi Help Needed

This is a discussion on WinApi Help Needed within the Windows Programming forums, part of the Platform Specific Boards category; i am new to winapi and i am a little bit stuck if i have a dos based code like ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    8

    WinApi Help Needed

    i am new to winapi and i am a little bit stuck if i have a dos based code like this :

    Code:
     
    main ()
    {
    char examp[20];
    scanf("%s",examp);
    printf("%s",examp);
    }
    how can i transfer scanf and printf to winapi,i know that i should you a editbox,but how?

    thanks
    Last edited by spanker; 01-02-2008 at 10:46 AM.

  2. #2
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,614
    Not to be rude, but I don't think you're ready for Windows programming.
    And read this, concerning scanf: Need help with altering info on a txt file
    Also learn to indent:
    Code:
    int main ()
    {
    	char examp[20];
    	scanf(%s",examp);
    	printf("%s",examp);
    }
    And main should explicitly return int.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Also, there is a specific board for Windows Programming questions: http://cboard.cprogramming.com/windows-programming/

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,739
    That's right, so this thread has been moved.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Quote Originally Posted by spanker View Post
    how can i transfer scanf and printf to winapi,i know that i should you a editbox,but how?

    Those three lines become about two pages of WIN32 code!
    You need a message pump, callback, event handlers and winmain not a main.

    I suggest you read some tutes, search here for some links (ie http://winapi.foosyerdoos.org.uk/ by Ken Fitlike one of the mods.)

    WIN32 is not too hard, but a bit of a leap (in logic) from 'structured' applications (happens in a set sequence) to 'event driven' apps (responds as required to user/system events).

    Start simple, try a 'hello world' app first and work your way up.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with ZwQueryDirectoryFile for my Driver.
    By taDo in forum Windows Programming
    Replies: 9
    Last Post: 11-27-2008, 07:54 AM
  2. WinAPI & threading
    By @nthony in forum Windows Programming
    Replies: 17
    Last Post: 10-15-2007, 04:41 PM
  3. do i still need winAPI
    By datainjector in forum Windows Programming
    Replies: 8
    Last Post: 07-12-2003, 01:43 AM
  4. references for the winapi
    By stallion in forum Windows Programming
    Replies: 9
    Last Post: 01-28-2003, 01:56 AM
  5. WINAPI: Meaning of HDC ?
    By Mecnels in forum Windows Programming
    Replies: 1
    Last Post: 01-21-2002, 09:06 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21