confused

This is a discussion on confused within the C++ Programming forums, part of the General Programming Boards category; Hey guys, I'm completely new to c++ and i'm reading the opengl tutorials right now but i have one question. ...

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

    confused

    Hey guys,

    I'm completely new to c++ and i'm reading the opengl tutorials right now but i have one question. What compiler should i use becouse in the tutorial they are talking about
    Code:
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
    . But if i start devc++ with a win32 project i see
    Code:
    int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance,LPSTR lpszArgument, int nFunsterStil)
    i ahve visual c++ 6 , 2003 and 2005 and devc++. So its quite confusing for me as a starter

    sorry for my bad english i'm dutch

    i hope you can help me thx in advance,

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,473
    So what is the problem?
    The function type, name and arguments type - is the same, so the function is the same...

    Argument names can be changed as you like...
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    102
    Yep, the function takes the same type of parameters, in either way. I also have Dev-C++ and have been using much OpenGL. Both functions are almost identical except for what they call the variables passed in. The variables will still be the same value.
    My Favorite Programming Line:
    Code:
    #define true ((rand() % 2) ? true : false)

  4. #4
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    my question was which compiler should i use so i can do all of the tutorials ? i tried to compile this click here in visual c++ 2005 and i got allot of errors. this is the first error
    Code:
    Error	1	fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
    Last edited by a-slayeriq; 07-05-2007 at 08:29 AM.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    At the end of each lesson, there is something like this
    DOWNLOAD Dev C++ Code For This Lesson. ( Conversion by Dan )

    Pick the source code which matches your platform, someone's already done all the customisation work necessary for a number of compilers.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    why do i get this error in visual c++ 2005 and visual c++ 6
    Code:
    Error	1	fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    903
    Don't you read replies to your questions ? Besides, the answer is simple. The file stdafx.h does not exist. End of the line.

  8. #8
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    sorry Desolation i do read the replies but i dont see why it doesnt compile/run becouse stdafx.h does exist i searched with search and i found it only do i have to put it in a special folder ?

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    stdafx.h is a microsoft specific header file designed to speed up compilations with their "precompiled header" feature.

    Just try deleting that line from the source and try again.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    thx salem it worked so i never need that line ?

  11. #11
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    If...
    - you have that file included in the source code, AND
    - your compiler is microsoft visual studio, AND
    - you enable precompiled headers in the IDE, AND
    - your project is on the large side, THEN
    maybe, just maybe, your project will compile a bit quicker.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  12. #12
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    ok thx

  13. #13
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    'm completely new to c++ and i'm reading the opengl tutorials right now
    That's probably not a good idea.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  14. #14
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Quote Originally Posted by CornedBee View Post
    That's probably not a good idea.
    Especially if you're confused by WinMain()'s parameter names.... That's hardly the first thing you should be confused with.

  15. #15
    Registered User
    Join Date
    Jul 2007
    Posts
    8
    so what should i learn first then ?

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Confused about Memory
    By gL_nEwB in forum C++ Programming
    Replies: 22
    Last Post: 06-20-2006, 07:32 PM
  2. why wont this compile?!? :confused:
    By jdude in forum C++ Programming
    Replies: 5
    Last Post: 11-25-2004, 12:13 AM
  3. So Now Im getting confused?!?!?
    By zergdeath1 in forum C++ Programming
    Replies: 11
    Last Post: 03-06-2004, 04:41 PM
  4. confused.. in selecting my line of deapth
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-04-2003, 01:21 PM
  5. Extern Question, really confused
    By SourceCode in forum C Programming
    Replies: 10
    Last Post: 03-26-2003, 10:11 PM

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