Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PROGGRAMMING USING DIALOGUE BOXES INSTEAD OF DOCUMENT FORMS Pin
David Crow10-May-04 2:52
David Crow10-May-04 2:52 
QuestionHow to compile the source code of ms windows 2000? Pin
fat8889-May-04 21:20
fat8889-May-04 21:20 
AnswerRe: How to compile the source code of ms windows 2000? Pin
Maxwell Chen9-May-04 21:22
Maxwell Chen9-May-04 21:22 
GeneralRe: How to compile the source code of ms windows 2000? Pin
Steve S9-May-04 21:39
Steve S9-May-04 21:39 
AnswerRe: How to compile the source code of ms windows 2000? Pin
nguyenvhn10-May-04 0:25
nguyenvhn10-May-04 0:25 
AnswerRe: How to compile the source code of ms windows 2000? Pin
toxcct10-May-04 0:43
toxcct10-May-04 0:43 
AnswerRe: How to compile the source code of ms windows 2000? Pin
Antony M Kancidrowski10-May-04 1:32
Antony M Kancidrowski10-May-04 1:32 
QuestionWhy is the window destroyed with an error? Pin
sinbaski9-May-04 21:17
sinbaski9-May-04 21:17 
I wrote a simple win32 application using VC6.0. In the below are my codes. Can you tell me why this program always quit with an error? Thank you for your help!

LRESULT CALLBACK mainWndProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (uMsg)
{
case WM_CREATE:
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd, &ps);
TextOut(hdc, 0, 0, "I love you.", 15);
EndPaint(hwnd, &ps);
return 0;
case WM_SIZE:
return 0;
case WM_CLOSE:
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
return DefWindowProc(hwnd, uMsg, wParam,lParam);
default:
return DefWindowProc(hwnd, uMsg, wParam,lParam);
}
return 0;
}

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
HWND hwndMain;

WNDCLASS wndClass;
MSG message;
hinstance=hInstance;
int nRet;

if(hinstance)
{
wndClass.style=0;
wndClass.lpszClassName="MainWindow";
wndClass.lpszMenuName="MainMenu";
wndClass.lpfnWndProc=mainWndProc;
wndClass.hInstance=hinstance;
wndClass.hCursor=LoadCursor(NULL, IDC_ARROW);
wndClass.hIcon=LoadIconhinstance,
"icon1.ico");
wndClass.hbrBackground= (HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.cbClsExtra=0;
wndClass.cbWndExtra=0;
}

RegisterClass(&wndClass);
hwndMain=CreateWindow( "MainWindow", "Test main",
WS_OVERLAPPEDWINDOW | WS_HSCROLL |
WS_VSCROLL, // vertical scroll bar
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
(HWND)NULL,
(HMENU)NULL,
hInstance,
NULL);

if(!hwndMain) return false;

ShowWindow(hwndMain, SW_SHOWDEFAULT);
UpdateWindow(hwndMain);

do
{
nRet=GetMessage( &message, hwndMain, 0, 0 );
if(!nRet)
{
break;
}
if(nRet==-1)
{
//log the error
return 0;
}
else
{
TranslateMessage(&message);
DispatchMessage(&message);
}
}
while(1);
return message.wParam;
}
AnswerRe: Why is the window destroyed with an error? Pin
nguyenvhn10-May-04 0:33
nguyenvhn10-May-04 0:33 
QuestionHow to find memory allocated to a linked lists Pin
jani_the_great9-May-04 20:46
jani_the_great9-May-04 20:46 
AnswerRe: How to find memory allocated to a linked lists Pin
Maxwell Chen9-May-04 21:03
Maxwell Chen9-May-04 21:03 
AnswerRe: How to find memory allocated to a linked lists Pin
toxcct9-May-04 21:16
toxcct9-May-04 21:16 
AnswerRe: How to find memory allocated to a linked lists Pin
vividtang11-May-04 1:16
vividtang11-May-04 1:16 
GeneralNeed help Pin
Aigledefer9-May-04 20:00
Aigledefer9-May-04 20:00 
GeneralRe: Need help Pin
_foo9-May-04 20:18
_foo9-May-04 20:18 
GeneralRe: Need help Pin
Aigledefer10-May-04 0:36
Aigledefer10-May-04 0:36 
GeneralRe: Need help Pin
Mike Dimmick10-May-04 1:38
Mike Dimmick10-May-04 1:38 
GeneralCFileDialog/AutoComplete Problem Pin
timo_the_man9-May-04 19:52
timo_the_man9-May-04 19:52 
GeneralReading from a socket Pin
monrobot139-May-04 18:33
monrobot139-May-04 18:33 
GeneralRe: Reading from a socket Pin
Member 10582029-May-04 18:46
Member 10582029-May-04 18:46 
GeneralRe: Reading from a socket Pin
David Crow10-May-04 2:59
David Crow10-May-04 2:59 
GeneralAnyone used c-tree plus by FairCom Pin
Joe Woodbury9-May-04 17:56
professionalJoe Woodbury9-May-04 17:56 
GeneralRe: Anyone used c-tree plus by FairCom Pin
Steve S9-May-04 21:35
Steve S9-May-04 21:35 
GeneralRe: Anyone used c-tree plus by FairCom Pin
David Crow10-May-04 3:00
David Crow10-May-04 3:00 
Generalsending mails using SMTP Pin
Member 10582029-May-04 17:47
Member 10582029-May-04 17:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.