| Main |< Configure And Use Windows PSDK 1 | C/C++ Array Data Type 1 >| Site Index | Download |


 

 

 

 

 

The Win32 Windows Programming

Configure And Using Windows PSDK- Part 4

 

 

 

 

 

Items in this page:

 

  1. Building and running a Win32 Windows C program sample.

  2. Windows Device Driver Kit, DDK/WDK.

 

 

 

 

 

 

 

 

 

 

 

// test program for Windows PSDK

#include <windows.h>

#include <stdio.h>

 

int main()

{

    // handle for file

    HANDLE hFile;

    // file and its path, the VC++ 2005 EE has been set to use unicode/wide character set...

    LPCWSTR fname = L"c:\\mytestfile.txt";

    // pointer to a variable that receives a set of bit flags that

    // specify properties of the object handle. Used in GetHandleInformation()

    DWORD lpdwFlags[100];

    BOOL test;

   

    // create a file with the given name

    hFile = CreateFile(fname,                  // file to be opened

                GENERIC_WRITE,                 // open for writing

                FILE_SHARE_WRITE,          // share for writing

                NULL,                                      // default security

                CREATE_ALWAYS,             // create new file only

                FILE_ATTRIBUTE_NORMAL |FILE_ATTRIBUTE_ARCHIVE | SECURITY_IMPERSONATION,

                                                                // normal file archive and impersonate client

                NULL);                     // no attribute template

    // check the return value...

    if(hFile == INVALID_HANDLE_VALUE)

        printf("Could not open %ls file, error %d\n", fname, GetLastError());

    // just to check the hfile address...

    printf("hfile address is = %p\n", hFile);

    // print some info...

    printf("%ls file HANDLE is OK!\n", fname);

    test = GetHandleInformation(hFile, lpdwFlags);

    printf("The GetHandleInformation() return value is %d, error %d\n", test, GetLastError());

    // don't forget to close the opened file handle

    CloseHandle(hFile);

    // optionally delete the created file. Try uncomment it DeleteFile(fname);

    return 0;

}

VC++ 2005 Express Edition - output for the first Win32 Windows program example

VC++ 2005 Express Edition - Win32 program, verifying the file creation

VC++ 2005 Express Edition - Win32 program rebuilding - an error indication

VC++ 2005 Express Edition - enabling Windows Application option in the Wizard

// WIN_APP.disabled = true;

// WIN_APP_LABEL.disabled = true;

// DLL_APP.disabled = true;

// DLL_APP_LABEL.disabled = true;

VC++ 2005 Express Edition - editing AppSettings.htm file to enable certain project wizard options

 

VC++ Express Edition 2005 - Windows Application option under Application type was enabled

VC++ Express Edition 2005 - Enabling other project wizard options

 

VC++ Express Edition 2005 - Enabling other project wizard options Static Library with ATL and MFC

 

 

 

 

 

 

 

 

 

 

VC++ Express Edition 2005 - Enabling other project wizard options Static Library with ATL and MFC verification

Windows Device Driver Kit (DDK)

Item needed

What we can do?

Visual C++ Express Edition/Visual Studio Express.

Building C/C++ console mode applications, standard C and Microsoft C.

PSDK/SDK

Building C/C++ Windows based applications that include Win32 (Console mode Applications), Windows GUIs such as Windows forms, MFC, ATL, COM etc. PSDK/SDK should coming with Visual Studio 2003/2005 that includes Visual C++ 2003/2005 .Net.

DDK/WDK

Building C/C++ Windows device drivers.

 

--------------------------End Windows pSDK: install, configure and use-----------------------

 

 

 

 

 

 

| Main |< Configure And Use Windows PSDK 1 | C/C++ Array Data Type 1 >| Site Index | Download |


Windows SDK-Download, Install, Configure and Use: Part 1 | Part 2 | Part 3 | Part 4