Hello,

I am using dev-c++ on a windows computer. I download a gui package off of the bloodshed dev site. I installed and everything seem to work. I was making a simple gui off of this tutorial I found online that used the library. The library is wxWindows. Here is the code of the header file and of the main file.

The header file (base.h)

#ifndef __BASE_H
#define __BASE_H
class MainApp: public wxApp
{
	public:
			virtual bool OnInit();
};
class MainFrame: public wxFrame
{
	public:
			MainFrame(const wxString &title, const wxPoint &pos, const wxSize &size);
};
#endif

the main program (base.cpp)

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <base.h>
IMPLEMENT_APP(MainApp)
bool MainApp::OnInit()
{
		MainFrame *MainWin = new MainFrame("Hello, World!", wxDefaultPosition,
		wxSize(300, 200));
		MainWin->Show(TRUE);
		SetTopWindow(MainWin);
		
		return TRUE;
}
MainFrame::MainFrame(const wxString &title, const wxPoint &pos, const wxSize &size)
		 :wxFrame((wxFrame *) NULL, -1, title, pos, size)
{
   //this is not needed right now. From what i know this does the controls of the program, and it was not needed for a simple window. 
}

Recommended Answers

All 11 Replies

What is your question?

Are you using the wxWidgets IDE for Dev-Cpp?
If not, check:
http://wxdsgn.sourceforge.net/

This IDE turns Dev-Cpp into the closest free thing to Visual C++.

No, I download and installed wxWindows. It was a package for dev-c++, and it is a GUI library. When I tried to compile the program a lot of errors came up. I was asking if anyone who used or is using wxWindow can help me make sure the compiler can compile the program. I am not using wxWidget, btw what is that?

No, I download and installed wxWindows. It was a package for dev-c++, and it is a GUI library. When I tried to compile the program a lot of errors came up. I was asking if anyone who used or is using wxWindow can help me make sure the compiler can compile the program. I am not using wxWidget, btw what is that?

The wxWidget IDE ties Dev-C++ and wxWindows together. It is a complete development package and includes Dev-C++, the beta download is free. Check:
http://wxwidgets.org/

I installed it, but I don't know what to do from here. It has sample program that shows all of the things it can do, and you can modify and change stuff.

I went to the forum, and they said I was missing DECLARE_APP. I have no idea where this would go. The person who responded said it might go after the mainapp class in the header file, I tried it and it did not work. Does anyone have any idea?

Well, I found a solution to my problem. When you install the package in dev C++, you have to go to new project, then you go to the gui tab and open up the wxWindows template. Another thing that can be done is to download the wx-Dev C++ which has everything set up already and has a visual building program built in, that you can creat and then you can add code to the buttons and everything else in the program.

Well, I found a solution to my problem. When you install the package in dev C++, you have to go to new project, then you go to the gui tab and open up the wxWindows template. Another thing that can be done is to download the wx-Dev C++ which has everything set up already and has a visual building program built in, that you can creat and then you can add code to the buttons and everything else in the program.

Congratulations!! I am glad you got this thing to go!! I played around with wx a few months ago. Sort of enjoyed it, despite the bloated executables! Then I got involved with c#. There is a lot of good stuff out there and not enough time to experience it all!!!!!

Yeah, after I figured download the wxWindows with dev-c++, I was looking at my original code and found some mistakes. I hate the mistakes that are not always obvisous. wxWindows is pretty good from what i have done so far (altough it was tricky to install and make it work). BTW, I have heard about c# but I dont exactly know what it is about, can you possibly tell me about it.

I like C# and, in Windows Applications, find the flow of the code much easier to follow than that of the corresponding C++ code . Some folks say that it is a mix of Java and class-only C++. I think of it as Delphi in a classy C++ coat, with the added benefit of having the designed form nested inside the main code.

To get a taste of what the code looks like, check the csharp snippets right here on DaniWeb. Some code and tutorials are found on:
http://www.c-sharpcorner.com/language.asp

There is a lot of help at Microsoft (.NET), google for it!

For a nice free setup to get your C# experience going, you need to download the IDE called SharpDevelop_1.0.3.1761_Setup.exe from:
http://www.icsharpcode.net/opensource/sd/

and the .NET Framework Version 1.1 Redistributable Package called dotnetfx.exe from (watch any wordwrap here!):
http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157-034D1E7CF3A3&displaylang=en

Unless you have .Net FX 1.1 already installed, install the dotnetfx first
followed by the IDE. Answer a view questions, and you are ready to code in C#. Start your projects (called Combines) and select the right application type (Win or Con). Windows Applications allow for the use of the Form Builder similar to wxDev-Cpp, Delphi or VB. There is a little tab near the bottom called Design, click on that to bring up the Form Builder. Now you can create your buttons, fileDialogs, labels and other components with ease.

There is one caveat, when you hand your programs to friends, they need the .NET Framework Redistributable Package installed on their computers too! Easy to do!

Hope that will help you!

thanks for the information on c# vegaseat. I will have to try it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.