how to run a simple Win32 applicaiton

I have started reading Win32 API from this site
http://winprog.org/tutorial/
there is a program to create a simple window. I have read it but how to
compile and run this program using WDK?
I have read the WDK documentation and found how to build this, but dont know
how to compile and run this just like we comile and run
a simple C program in DevC++ IDE.

Do I always need to create two files…makefile and sources?

santosh tripathi wrote:

I have started reading Win32 API from this site
http://winprog.org/tutorial/
there is a program to create a simple window. I have read it but how
to compile and run this program using WDK?
I have read the WDK documentation and found how to build this, but
dont know how to compile and run this just like we comile and run
a simple C program in DevC++ IDE.

Do I always need to create two files…makefile and sources?

If you are just learning the Win32 API, why on EARTH would you try to do
it using the WDK? Just download Visual Studio 2008 Express Edition,
which is free.

Yes, a minimum WDK project requires both makefile and sources.

C:\tmp\x>type Makefile
!INCLUDE $(NTMAKEENV)\makefile.def

C:\tmp\x>type Sources
TARGETNAME=testing
TARGETTYPE=PROGRAM
UMTYPE=console
USE_MSVCRT=1

SOURCES= testing.cpp

C:\tmp\x>type testing.cpp
#include <stdio.h>

int __cdecl main()
{
puts( “Hello, world!” );
return 0;
}

C:\tmp\x>build -c
BUILD: Compile and Link for x86
BUILD: Loading c:\ddk\6001.18002\build.dat…
BUILD: Computing Include file dependencies:
BUILD: Start time: Fri Apr 03 09:59:35 2009
BUILD: Examining c:\tmp\x directory for files to compile.
BUILD: Saving c:\ddk\6001.18002\build.dat…
BUILD: Compiling and Linking c:\tmp\x directory
_NT_TARGET_VERSION SET TO WINXP
Compiling - testing.cpp
Linking Executable - objfre_wxp_x86\i386\testing.exe
BUILD: Finish time: Fri Apr 03 09:59:37 2009
BUILD: Done

3 files compiled - 7 LPS
1 executable built

C:\tmp\x>objfre_wxp_x86\i386\testing.exe
Hello, world!

C:\tmp\x>


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.</stdio.h>

would you please explain makefile and sources? what exactly we should put onto these files?
each time do I need to change only the targetname and sources entry in sources file when I make a new simple Win32 application except a larger project?

I cant download visual studio express edition right now, thats why I am using WDK.

don’t get annoyed of me, I am very new in studying Win32 API.

Using this method has nothing to do with the Win32 API. The support for
applications is very limited and outdated if any GUI is involved. Using the
WDK for applications is mostly for command line utilities. If you really
want to study the Win32 API do as others have suggested and get the free
Visual Studio Express Edition. Look at the samples for the sources and
makefile. Then read makefile.new to see how all it all fits together. I
just don’t think you will get very far since you haven’t learned how to do
it via Visual Studio.

wrote in message news:xxxxx@ntdev…
> would you please explain makefile and sources? what exactly we should put
> onto these files?
> each time do I need to change only the targetname and sources entry in
> sources file when I make a new simple Win32 application except a larger
> project?
>
> I cant download visual studio express edition right now, thats why I am
> using WDK.
>
> don’t get annoyed of me, I am very new in studying Win32 API.
>
>

ok, I’ll download it from somewhere else.
one more thing, in this package there are 6 contents
1 Visual Basic 2) Visual Web Developer 3) Visual C# 4) Visual C++ 5) SQL Server and
6) Web Plateform

I think all these doesn’t need to download but only Visual C++. Visual C++ probably have the compiler/Debugger utilities applied to practice with Win32 applications, is that so?

or should I download this whole package?
see, here speed is the issue so if the other ones doesn’t have any role in this then please let me know about.

> would you please explain makefile and sources? what exactly we should put onto these files?

Do exactly as Tim did, this is the simplest possible version.

You can also google for TARGETNAME, TARGETTYPE and so on.

each time do I need to change only the targetname and sources entry in sources file when I make a
new simple Win32 application except a larger project?

In general, yes.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

On Sat, Apr 04, 2009 at 01:59:01AM -0400, xxxxx@gmail.com wrote:

would you please explain makefile and sources? what exactly we should
put onto these files?

I showed you that, exactly.

each time do I need to change only the targetname and sources entry in
sources file when I make a new simple Win32 application except a larger
project?

Look, if you are building Win32 applications, then you do NOT want to use
the WDK. Just that easy.

I cant download visual studio express edition right now, thats why I am
using WDK.

don’t get annoyed of me, I am very new in studying Win32 API.

The key problem is that this mailing list is targeted at people who are
developing Windows drivers. This is an advanced subject, so if you are
just starting out in Win32 development, you don’t really belong here.

There are many mailing lists and forums aimed directly at Win32
developers, including beginning Win32 developers. You would be much
happier there.

Tim Roberts, xxxxx@probo.com
Providenza & Boeklheide, Inc.