Advertisement

Who knows Windows?

Started by August 23, 2000 11:47 AM
7 comments, last by NeRo 24 years, 4 months ago
I need some resorce for programming in windows without using mfc. Is there a good book or website anyone knows for a tutorial?
|============================|| Things Smell VERY different|| to a midget in an elevator||============================|
www.bcgrizzly.com/~theforger/

I think thats the link but the tutorial kicks ass.

http://users.50megs.com/crazyvasey/
Advertisement
http://bcgrizzly.com/~forger/winprog/tutorial/

thats the link.

http://users.50megs.com/crazyvasey/
I read that same tutorial some time ago and it was brilliant. I''m gonna go and take a look again and see whats been updated in it.

Regards,
David Stubbs
Regards,Dave
Programming in windows is as simple as including windows.h.

#include
#include

int main( int argc, char *argv[] )
{
CHAR *szBuffer = "Hello World!\n";
DWORD dwWritten = 0;
HANDLE hFile = CreateFile( "Hello World.txt", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );

if ( hFile == INVALID_HANDLE_VALUE )
{
printf( "can''t open file handle for new file.\n" );
return 1;
}

if ( ! WriteFile( hFile, szBuffer, strlen( szBuffer ), &dwWritten, NULL ) )
{
printf( "Unable to write to file." );
return 1;
}

return 0;
}


Just make sure you include kernel32.lib.

By Default VS6 will include the following libs:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Which cover just about all win32 api functions.


MSDN.MICROSOFT.COM is by far the best place.
Personally I really like the Win32.hlp files that came with Delphi or Borland Builder. It''s easy, it''s fast and complete.
I''m also using the winsock2 and OpenGL versions of this help A LOT.

Advertisement
Petzold is THE author. Read his book on Windows programming.
Hey man, thanks for the link! I''ve been looking for something like that for a long time. Would you happen to have any specific books in mind too? I really want to learn windows programming, but I really don''t want to deal with MFC. Thanks..

BronYrAur
I''ll just say the same thing that Stoffel, because indeed Petzold book rulez big big time.

I learnt windows programming this year for my main project, and I can tell you I couldn''t have done anything without his book.

As for learning the WINAPI, I think you''ll have a much better time, because most tutorials still seem to be using it (I guess it''s because DirectX examples are all in WINAPI).

But honestly, once you understand what MFC is all about, it''s very nice to use, and very practical (much much more than the API if you have to do your own dialogues and windows).

Also try the msdn.microsoft.com
It sounds weird to say that, but quite curiously those people at Micro$oft seem to know a lot of things about the Windows APi, and the MFC.

Hey wait ! didn''t they code the whole thing ? Ah yes, this explains that

youpla :-P

------
RTFM !
-----------------------------Sancte Isidore ora pro nobis !

This topic is closed to new replies.

Advertisement