MSSQLWIKI

Karthick P.K on SQL Server

how to Open CreateFile (Createfile example)

Posted by Karthick P.K on March 10, 2011

#include <windows.h> 
#include <string> 
#include <winbase.h> 
#include <iostream> 
using namespace std;

void main()
{
    HANDLE  h;
    CHAR *filename;
 
    filename =new CHAR[2500];
    wcout<<"enter the file name:";
    cin.getline (filename,2500);
    h= CreateFile( filename,FILE_SHARE_READ,0x00000001,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
    cout<<filename;
    if (h!=INVALID_HANDLE_VALUE)
    {
    printf("File is opened");
    }
    else
    {
    printf("Unable to open or create file");
    }
    system ("pause");

}

3 Responses to “how to Open CreateFile (Createfile example)”

  1. […] how to Open CreateFile (Createfile example) […]

  2. dodo said

    Not worked.

  3. Jewelery forms of the 1940`s are recognized by the visibility of yellow or tinted (green) gold,
    and likewise often rose gold (pink gold).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: