Page 1 of 1
Creating plain GUI WinAPI project
Posted: Mon Jul 02, 2012 1:08 pm
by Fred
Hello,
thank you for providing codelite.
I just installed prebuilt 4.0.5589 incl. MinGW on Vista SP2 and tested building a console app without problems.
My question:
How can I create a new plain GUI Windows API C++ project (without qt, widgets etc.)?
I didn't find any selection for this in the create project dialog.
Thanks,
Fred
Re: Creating plain GUI WinAPI project
Posted: Mon Jul 02, 2012 8:47 pm
by eranif
Download the attached zip file
WinAPIProject.zip
and extract it to:
Code: Select all
C:\Program Files (x86)\CodeLite\templates\projects
(assuming that this is where you installed codelite)
Next, go to main menu:
Workspace | New Project | GUI | WinAPIProject
It will give you a basic Debug / Release configuration with a sample main.cpp file that creates a basic WIndow
Eran
Re: Creating plain GUI WinAPI project
Posted: Tue Jul 03, 2012 10:01 am
by Fred
Hello Eran,
thank you for your fast reply!
This works as expected.
I added an icon.png to the directory, too.
I assume, that it is possible to change the code of the template main.cpp?
Is the syntax of CodeLite project xml-files documented somewhere, so that users can create their own project types?
Thanks,
Fred
Re: Creating plain GUI WinAPI project
Posted: Tue Jul 03, 2012 11:48 am
by eranif
Fred wrote:I assume, that it is possible to change the code of the template main.cpp?
Once the project is created from the template, you can modify it, add new files , delete files etc.
Ofc, it will not affect the template.
Fred wrote:Is the syntax of CodeLite project xml-files documented somewhere, so that users can create their own project types?
There is no need to manually edit the XML files.
To create your own custom templates, create an empty project throw in a sample main.cpp file, edit the project settings to fit your needs.
Once you are done, right click on the project and select 'Save as template', give it a name, description and category
This is how I created the WinAPI template: I created a simple console application, added the '-mwindows' flag to the link options to avoid the black CMD window.
Replaced the the default main.cpp content with something I pulled out of the internet saved it as template and posted it on the forum
Eran
Re: Creating plain GUI WinAPI project
Posted: Tue Jul 03, 2012 12:07 pm
by Fred
Thanks Eran,
'Save as template' is a useful feature!
Can a template be deleted by deleting its directory or does CL keep a reference to it somewhere?
Fred
Re: Creating plain GUI WinAPI project
Posted: Tue Jul 03, 2012 7:38 pm
by eranif
codelite does not keep a reference to it.
It simply scans the 'template' directory each time a the 'new project dialog' is loaded.
so if you delete that folder you will lose the template
Eran
Re: Creating plain GUI WinAPI project
Posted: Tue Jul 03, 2012 10:19 pm
by Fred
Hi Eran, thank you for your reply.
That's great, users can add and delete project types freely (if they have admin rights on Vista ++, as write access to a Programs subfolder is required).
I'll try this now for Win32 ANSI and Unicode exes and dlls with my standard code templates.
Thanks and regards,
Fred