|
프로젝트 생성시..
consol wizard를 선택을 안하신거 같네요..
리소스 님이 쓰신 글 :
: 도대체 머가 이상이 있는지 정말 모르겠습니다..
: 리소스 등록은 Tool->Image Editer에서 했는데...
: 이것도 맞게 등록했는지 모르겠고여
: c++에서는 정상적으로 실행이 되는데 왜 빌더에서는 안되는지 ㅡ.ㅡ;;
:
: c++에서는 리소스를 등록하면 자동으로 resource.h가 생성되는데 빌더에서는 생성되는 않는거
: 같고염
:
: 아무튼 이렇게 실행하면 bitmap이미지가 출력되지 않고 그냥 폼만 생성됩니다...
: 고수님들은 많은 가르침 부탁드립니다..!!!
:
: //---------------------------------------------------------------------------
:
: #include <vcl.h>
: #include <windows.h>
: #include <math.h>
: #include "resource.h" -> 이상
:
: #pragma hdrstop
:
: //---------------------------------------------------------------------------
:
: #pragma argsused
:
: LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
: HINSTANCE g_hInst;
: LPSTR lpszClass="Unit1";
:
: WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow)
: {
: HWND hWnd;
: MSG Message;
: WNDCLASS WndClass;
: g_hInst=hInstance;
:
: WndClass.cbClsExtra=0;
: WndClass.cbWndExtra=0;
: WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
: WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
: WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
: WndClass.hInstance=hInstance;
: WndClass.lpfnWndProc=(WNDPROC)WndProc;
: WndClass.lpszClassName=lpszClass;
: WndClass.lpszMenuName=NULL;
: WndClass.style=CS_HREDRAW | CS_VREDRAW;
: RegisterClass(&WndClass);
:
: hWnd=CreateWindow(lpszClass,lpszClass,WS_OVERLAPPEDWINDOW,
: CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
: NULL,(HMENU)NULL,hInstance,NULL);
:
: ShowWindow(hWnd,nCmdShow);
: UpdateWindow(hWnd);
:
: while(GetMessage(&Message,0,0,0)) {
: TranslateMessage(&Message);
: DispatchMessage(&Message);
: }
: return Message.wParam;
: }
:
: LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
: {
:
: HDC hdc,MemDC;
: PAINTSTRUCT ps;
: HBITMAP MyBitmap, OldBitmap;
:
: switch(iMessage) {
:
: case WM_PAINT:
: hdc = BeginPaint(hWnd, &ps);
:
: MemDC=CreateCompatibleDC(hdc);
:
: MyBitmap=LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_BITMAP1));
: OldBitmap=(HBITMAP)SelectObject(MemDC, MyBitmap);
:
: BitBlt(hdc, 0,0,123,160,MemDC,0,0,SRCCOPY);
:
: SelectObject(MemDC,OldBitmap);
: DeleteObject(MyBitmap);
:
: DeleteDC(MemDC);
:
: EndPaint(hWnd, &ps);
: return 0;
:
: case WM_DESTROY:
: PostQuitMessage(0);
: return 0;
: }
: return(DefWindowProc(hWnd,iMessage,wParam,lParam));
: }
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
|