Menu

Making a Windows app in Dev C++

2009-06-27
2012-09-26
  • Michael Libowitz

    Hi

    I'm using dev C++ and want to make a windows app instead of making console programs all the time. The problem is when i go file new and select windows app it loads up a page with pre written code and i dont know where to put my code in or how to modify the program.

    Any assistance would be much appreciated
    mtizz1

     
    • cpns

      cpns - 2009-06-28

      Dev-C++ is not the easiest way to write GUI apps. You have no 'visual' tools or even a basic resource editor. The most widely accepted work on this kind of lowest common denominator Win32 programming is this: http://www.charlespetzold.com/pw5/index.html

      If you want a free resource on the subject, many people appear to use this: http://winprog.org/tutorial/

      Since programming Win32 at this level is not really 'state-of-the-art' you may choose to take a different route altogether. wxDev-C++ (a variant of Dev-C++ for visual development of Win32 using the wxWidgets class library) http://wxdsgn.sourceforge.net/

      Microsoft's preferred (and best supported) developer environment for GUI these days is the .NET framework and Windows Forms. For that you will need a different tool altogether. Microsoft's VC++ 2008 Express is free and very powerful, and can do console and Win32 development too, so in most respects is better than Dev-C++ even if you choose not to use .NET/Windows Forms.

      .NET devlopnment in C++ however requires language extensions called C++/CLI. Personally I found this so bizarre, that I found it easier to just learn a new and more appropriate language. C# was designed from the ground-up to work with .NET and is a much cleaner solution to Windows Forms/.NET development. There is a Visual C# Express as well if you choose to do that. Check out all of Microsoft's free tools at http://www.microsoft.com/exPress/

      Clifford

       
    • Michael Libowitz

      Thanks, before i started with C i was programming in Visual Basic which is object orientated and event driven so guess i still have that event driven instinct towards programming. The websites did help a lot and i have downloaded microsoft visual c++ express.

      Thanks,
      mtizz1

       
    • cpns

      cpns - 2009-06-29

      > [...] Visual Basic which is object orientated [...]

      hmm... for sufficiently loose definitions of OO! Unless you are talking about VB.NET that is?

       
    • B Cox

      B Cox - 2009-07-19

      Hello:

      I had also chosen the Windows App for my New project in Dev C++ on Windows Xp. But I got error in compiling when I tried to run Example programs for Nonlinear Least-Squares Fitting,
      http://www.gnu.org/software/gsl/manual/html_node/Example-programs-for-Nonlinear-Least_002dSquares-Fitting.html

      I copied the expfit.c on the top of the page and the main program into a main.cpp. But when I compiled the current file in Dev C++, I got various errors, such as

      97 C:\Dev-Cpp\main.cpp expected ,' or...' before '*' token

      for the line
      expb_f (const gsl_vector * x, void *data, gsl_vector * f)

      How do we get the example to run properly in Dev C++ 4.9.9.2? What am I doing wrong?

      Thx very much!!

       
    • cpns

      cpns - 2009-07-21

      > But I got error in compiling when I tried to run Example programs
      > for Nonlinear Least-Squares Fitting

      Judging form the URL, this code required the GNU Scientific Library (GSL). This is not part of teh Dev-C++ package, you need to download and install that separately, as described in your thread: https://sourceforge.net/forum/forum.php

      When posting to threads started by others you should generally restrict yourself to adressing the OP's problem. This is not your thread, and your problem is entirely unrelated to teh original question. You should have started your own thread on this; but from your other thread it seems you have already realised the solution.

      Either way your problem report is lacking. Read the " PLEASE READ BEFORE POSTING A QUESTION" thread. You will see that the complete log text is requested from the "Compile Log" tab, not single messages from the filtered "Compiler" tab.

      Clifford

       
    • Michael Libowitz

      Sorry forgot to mention im using Windows XP and am coding in C

       
    • cpns

      cpns - 2009-06-28

      ... PS.

      You may also want to check out some of the example Win32 GUI projects in the c:\dev-cpp\examples folder. Copy them to a new folder outside of c:\dev-cpp before building them. This avoids potential problems with the build and also preserves the originals code should you need to revert to them again.

      You must realise that GUI programs are event driven. That is they respond to event messages, like a mouse click or movement, or a control activation, or timer message etc. That is what the 'message loop' in the example code is for. Code is written to respond to an event, and then wait for the next event. This is fundamentally different from the behaviour of most console applications.

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.