(C) Windows API BMPファイルを表示できない
Posted: 2013年9月24日(火) 00:22
CのWindows APIを書籍を使って勉強中でビットマップを表示させようとしているのですが上手くいきません
よければ教えてください、お願いします!
ソースファイルなどは全て同じフォルダに入れています
エラー内容
error RC1004: unexpected end of file found (ファイルパス)..\Header.h
よければ教えてください、お願いします!
ソースファイルなどは全て同じフォルダに入れています
エラー内容
error RC1004: unexpected end of file found (ファイルパス)..\Header.h
//Header.h
#include <Windows.h>
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
ATOM InitApp(HINSTANCE);
BOOL InitInstance(HINSTANCE, int);
HINSTANCE hInst;
TCHAR szClassName[] = TEXT("Windows Program sample");
//source.c
#include "Header.h"
//(省略)
//ウィンドウプロシージャ
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
{
PAINTSTRUCT ps;
HDC hdc, hMdc;
HBITMAP hbmp;
BITMAP bmp_info;
int w, h;
switch (msg)
{
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
hbmp = LoadBitmap(hInst,TEXT("BMP"));
GetObject(hbmp, (int)sizeof(BITMAP), &bmp_info);
hMdc = CreateCompatibleDC(hdc);
SelectObject(hMdc, hbmp);
w = bmp_info.bmWidth;
h = bmp_info.bmHeight;
BitBlt(hdc, 0, 0, w, h, hMdc, 0, 0, SRCCOPY);
StretchBlt(hdc, w, 0, w*2, h*2,
hMdc, 0, 0, w, h, SRCCOPY);
DeleteDC(hMdc);
DeleteObject(hbmp);
break;
//省略