Everyday is Xmas Eve in Savone World!! | 유원미
http://blog.naver.com/savone/80007815552
http://blog.naver.com/savone/80007815552
#include <windows.h>
#include <tchar.h>
void err_quit(LPCTSTR msg)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
MessageBox( NULL, (LPCTSTR)lpMsgBuf, msg, MB_ICONERROR);
LocalFree( lpMsgBuf );
ExitProcess(-1);
}
int main(int argc, char* argv[])
{
HANDLE hFile = CreateFile( _T("readme.txt"),
GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if( hFile == INVALID_HANDLE_VALUE )
{
err_quit(_T("CreateFile()"));
}
return 0;
}
댓글
댓글 쓰기