Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2008 by Ivor Horton; ISBN: 9780470225905
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2010, 10:46 PM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default execute Ex12_01 no result

#include <windows.h>
//#include <iostream>
//#include <stdio.h>
//using namespace std;

LRESULT CALLBACK WindowFirstProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd
)
{
WNDCLASS myWindow ;

static LPCTSTR szAppName="OFWIN";
HWND hwnd;
MSG msg;

//myWindow.cbSize=sizeof(WNDCLASSEX);
myWindow.style =CS_HREDRAW | CS_VREDRAW;
myWindow.lpfnWndProc=WindowFirstProc;
myWindow.cbClsExtra=0;
myWindow.cbWndExtra=0;
myWindow.hInstance= hInstance;
myWindow.hIcon=LoadIcon(0,IDI_APPLICATION);
myWindow.hCursor=LoadCursor(0,IDC_ARROW);
myWindow.hbrBackground=(HBRUSH)GetStockObject(WHIT E_BRUSH);
myWindow.lpszMenuName=NULL;
myWindow.lpszClassName=szAppName;
//myWindow.hIconSm=0;

RegisterClass(&myWindow);

//hwnd = CreateWindow("sunxin2006","http://www.sunxin.org",WS_OVERLAPPEDWINDOW,
//0,0,600,400,NULL,NULL,hInstance,NULL);
hwnd = CreateWindow("First_Window_1","First_Window",WS_OV ERLAPPEDWINDOW,0,0,100,100,NULL,NULL,hInstance,NUL L);

ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);

while(GetMessage(&msg,NULL,0,0)==TRUE)
{
TranslateMessage(&msg);
DispatchMessage(&msg);

}
return msg.wParam;

}
LRESULT CALLBACK WindowFirstProc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT Paintst;
RECT aRect;

switch(message)
{
case WM_PAINT:
hdc = BeginPaint(hwnd,&Paintst);

GetClientRect(hwnd,&aRect);

SetBkMode(hdc,TRANSPARENT);

DrawText(hdc,"Valcano's soft",-1,&aRect,DT_SINGLELINE | DT_CENTER | DT_VCENTER);

EndPaint(hwnd, &Paintst);

return 0;

case WM_DESTROY:
PostQuitMessage(0);
return 0;

default:

return DefWindowProc(hwnd,message,wParam,lParam);
//return 0;
}
}
Buliding no errors
execute it no result
give me some idears, TKS!
 
Old July 25th, 2010, 09:38 AM
Authorized User
 
Join Date: Feb 2010
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default

It looks as if your Ex12_01 code deviates substantially from the code in the book. Why?
 
Old July 27th, 2010, 10:41 AM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, it is. But bulit it and execute that there was nothing displaied.
 
Old July 27th, 2010, 10:42 AM
Registered User
 
Join Date: Jul 2010
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I execute it in vc++ 2008.





Similar Threads
Thread Thread Starter Forum Replies Last Post
get the execute query result in variable mahen_pali SQL Server 2005 2 April 7th, 2008 04:04 AM
GridView and SQL More than one result = one result DarkForce ASP.NET 2.0 Basics 0 July 20th, 2007 04:29 AM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
execute gauravchhabra9111 Apache Tomcat 0 January 24th, 2005 06:06 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.