boldinventions.com

KCMD Command Processor Documentation - Getting Started

KCMD is distributed as C source code. Also included are some demo projects for various platforms, and this documentation. Here we go through the process of creating a product which uses KCMD in detail with many screenshots.

Microsoft Visual C++ Express Edition is Free

One of the platforms KCMD has already been ported to is Windows, using the Microsoft Visual C++ 2008 compiler.

If you don't yet have Microsoft Visual C++, the express edition is available from Microsoft for free. It is not a time-limited demo or evaluation version. It is a slimmed-down version of their commercial product with the hobbyist in mind. Microsoft's page for Visual C++ 2008 Express Edition is here.

Since the Microsoft Visual C++ is a platform anybody who has a PC running Windows can use, we use this an example of how to create a project which has the KCMD command processor in it.

Creating a Microsoft Visual Studio 2008 project with KCMD

First, select File -> New Project

In the dialog box below, choose Win32 in the pane on the left, then select 'Win32 Console Application' on the right. Then fill in the name field with the name of your new project. Then press the 'OK' button.

msvc2008_create_project_dialog

Next we need to specify that we want an Empty Project. If we let MSVC create a starter application for you, it will make a C++ application, but right now we want our code to be all just plain old C language.

msvc2008_empty_project

Make sure the 'Empty Project' selection is checked, and press 'Finish'.

MSVC will make a new project with nothing in it but some folders.

Let's start out by making a Hello, World application.

So we RIGHT-click on the Source Files folder, and select Add->New Item

right-click-on-sources

And then we create a new C source file called 'main.c'

msvc2008_new_item_dialog

And now we edit our brand new main.c source file to make a hello, world application. Add the following code to main.c:

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <conio.h>

int main (int arcg, char *argv[])

{

printf("\nHello, World!\n");

printf("\nType any key to continue");

_getch();

}

Now save main.c and then chose 'Build Solution' from the build menu.

Then from the Debug menu, select 'Start Debugging'

msvc2008_hello_world_running_in_a_window

So we have our basic test of the platforms ability to compile and load a program, and to print output to the screen.

Next we want to add the kcmd processor to the project.

NEXT PAGE --->

Back to Index