PDA

Click to See Complete Forum and Search --> : Visual C++ question


Daok
Aug 9th, 2002, 10:41 AM
I have read some of the tutorial at :http://www.winprog.org about Visual C++ and it show how to make a simple window but in 2 different way and I do not know wich one choose now.

The first one is bigger and look like this :


WNDCLASSEX wc;
HWND hwnd;
MSG Msg;

wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
......................


And the other one is quite simple and it use the resource editor and I just write :

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);
}


The problem is with the seconde way I cannot see how to add icon to my program.

Daok

Technocrat
Aug 9th, 2002, 10:48 AM
Personally I would stay away from using the Dialog way to you learn how to do it the API way (first one). The other way can be trouble.

rajab natshah
Aug 9th, 2002, 05:08 PM
hi,
you can use hIconSm mumber to select Icon to your program

this noot frm MSDN

hIcon
Handle to the class icon. This member must be a handle of an icon resource. If this member is NULL, an application must draw an icon whenever the user minimizes the application's window.

Daok
Aug 9th, 2002, 05:25 PM
I have read about 50% of the tutorial on winprog.org and I found the Visual part very complex. Do you think I should buy a book or read more tutorial and I will be fine ?

rajab natshah
Aug 9th, 2002, 05:34 PM
hi,
Yes MasterDaok ,
if you read more know more..
good lack.. :)

CyberCarsten
Aug 9th, 2002, 07:38 PM
but unfortunately its very hard to find a book on pure API.
I went to the bookstore the other day and found 7 or so C++ programming books for newbies...all of them in MFC!
Is it really that hard to find an API book ???

parksie
Aug 10th, 2002, 11:42 AM
Petzold?

CornedBee
Aug 13th, 2002, 06:47 AM
Programming Windows
by Charles Petzold
Microsoft Press

CyberCarsten
Aug 13th, 2002, 11:17 AM
Can I use it with VC++ .NET???

parksie
Aug 13th, 2002, 11:19 AM
Yes, but it won't help you for the .NET framework. VC++ 7 still supports normal programs.

CyberCarsten
Aug 13th, 2002, 11:22 AM
Pew!! I just want to learn normal windows programming, so I shouldn't get any problems with VC.NET??

CornedBee
Aug 13th, 2002, 11:24 AM
No problems, except that the reference is very crowded.

parksie
Aug 13th, 2002, 11:25 AM
Originally posted by CornedBee
No problems, except that the reference is very crowded. Hmm, on the same scale that the Black Hole of Calcutta was a tad cramped.

CyberCarsten
Aug 13th, 2002, 11:25 AM
What do you mean??

CornedBee
Aug 13th, 2002, 11:34 AM
Huh?

parksie
Aug 13th, 2002, 11:36 AM
Is that to me?

CornedBee
Aug 14th, 2002, 08:29 AM
The "Huh?" is to you. I don't understand your joke, lack of English knowledge, and what's the "black hole of calcutta"?

parksie
Aug 14th, 2002, 11:45 AM
You said the reference was crowded, which is an understatement on the same level as the Black Hole of Calcutta was a tad cramped:

http://www.sscnet.ucla.edu/southasia/History/British/Blackh.html

I thought everyone knew the legend...

CornedBee
Aug 19th, 2002, 07:10 AM
Never heard of that. But then, I never cared about India or the UK.

parksie
Aug 19th, 2002, 07:13 AM
Originally posted by CornedBee
Never heard of that. But then, I never cared about India or the UK. Well, we don't really care about the UK either ;)