|
-
Aug 19th, 2000, 12:28 AM
#1
I want to write a pure runtime-free C++ program, that is small...
I dont want to use static(compiled as library) or dynamic(dll) MFC,
I want to learn how to create windows, get there hwnd, set there caption, set there position, etc in PURE C++(well of course it will be using API's )
and I want to learn how to make all of it, like Edit Boxes, Buttons, Dialogs, and Timers,
lets say I wanted to keep checked for keypress using GetAsyncKeyState, what would I do?
would I use a Do...Loop??
and I dont know how to do this,
say I just wanted a small app, perhaps a 40kb app in VB, with the MFC compiled static that would be about 2MB, with the dll, well it has a dll, and that sucks.
BTW how do you subclass in C++?
is it the same as the VB API way?
if so than how come it is so much harder to do it in VB than C++??
thanks for your help... thanks A LOT
-
Aug 19th, 2000, 07:09 AM
#2
Monday Morning Lunatic
In VB, subclassing is usually performed to get at messages VB doesn't already catch. In C++, you can catch whatever message you like. I'll send you a small example in a bit (it's a class to encapsulate all the window-creation crap, without using MFC). That is, once I've worked it out...
Seriously, though, the Platform SDK is incredibly helpful, and I would suggest you download it...it's in small pieces.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 19th, 2000, 10:44 AM
#3
The full/complete PSDK is around 500MB.
-
Aug 19th, 2000, 12:29 PM
#4
well I guess I wont be getting the platform SDK until I get $10 to send for the CD or DSL.....
-
Aug 19th, 2000, 12:34 PM
#5
thanks parksie!
In VB, subclassing is usually performed to get at messages VB doesn't already catch. In C++, you can catch whatever message you like.
so using the same method(setwindowlong, getwindowlong, etc) you can subclass?
but anywindow rather than only your own?
-
Aug 19th, 2000, 07:56 PM
#6
C++ (if I'm not mistaken) uses external libraries. If you were to use a DLL you could do it in VB as well.
-
Aug 19th, 2000, 08:49 PM
#7
OK,
if C++ uses external library's *** language do you write those in????
-
Aug 20th, 2000, 04:55 AM
#8
Monday Morning Lunatic
C++. *laughs*
They're all in C/C++, although a few deep kernel bits are probably in asm.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 20th, 2000, 05:58 AM
#9
Fanatic Member
Originally posted by denniswrenn
I want to write a pure runtime-free C++ program, that is small...
I dont want to use static(compiled as library) or dynamic(dll) MFC,
I want to learn how to create windows, get there hwnd, set there caption, set there position, etc in PURE C++(well of course it will be using API's )
and I want to learn how to make all of it, like Edit Boxes, Buttons, Dialogs, and Timers,
lets say I wanted to keep checked for keypress using GetAsyncKeyState, what would I do?
would I use a Do...Loop??
and I dont know how to do this,
say I just wanted a small app, perhaps a 40kb app in VB, with the MFC compiled static that would be about 2MB, with the dll, well it has a dll, and that sucks.
BTW how do you subclass in C++?
is it the same as the VB API way?
if so than how come it is so much harder to do it in VB than C++??
thanks for your help... thanks A LOT
In VC++ 6, you just go to New Project: Win32 Application: Hello! World.
That has CreatewidowEx, some 'skeleton' subclassing and s very simple menu.
(If this is a ridiculous answer, please don't blame me, blame the Big Bang)
-
Aug 20th, 2000, 11:05 AM
#10
thats a ridiculous answer and I blame you!
but I thought even the simple win32 apps used a resource file or something ?
and I know I can look at code samples, but I need to know how to create it from scratch....
if I look at code samples there might be some specific thing that I dont want, but dont know how to change..
-
Aug 20th, 2000, 11:09 AM
#11
Monday Morning Lunatic
You only use a resource file if you need one. Although most of the time, you do. One thing off-topic: Megatron (or anyone else), do you know how to pass a member function pointer to the CreateDialog function? Mine is refusing...
Technically, this is on-topic because it's about making Win32 apps
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 21st, 2000, 12:08 PM
#12
Lively Member
You can only pass a Static member function pointer. Because a non static function pointer has additional invisible arguments (The address of the object).
-
Aug 21st, 2000, 01:21 PM
#13
can somebody help me please?
I still dont know how to make a win32 application from scratch.......
thanks!
Dennis
-
Aug 21st, 2000, 01:27 PM
#14
Monday Morning Lunatic
I'll email you my development code...it's not particularly good, but it just about works .
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 21st, 2000, 02:42 PM
#15
-
Aug 21st, 2000, 03:11 PM
#16
Monday Morning Lunatic
It's a bit buggy...
I'm still working on it. I thought I'd send it so that you could see some preliminaries
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2000, 09:00 AM
#17
Lively Member
Here's the URL for the standard C generic windows
app code:
http://msdn.microsoft.com/library/ps...neric_6jjo.htm
If you really need the features of C++ and want the
smallest exec size then you'll have to forget MFC and
code your own classes. The above code is not really that
difficult to transform into a few classes if you examine it closely.
If you want simple to write, easy to read and easy to
maintain code then you'll have to use MFC which is going to
add a huge overhead and you'll of course 'inherit' all of
it's bugs and idiosyncrasies (Borland's libs are better).
You should consider using C++ Builder instead and if you
want the best of the best in ease, simplicity, light-speed
compile times, small fast code Vive Delphi!
-
Aug 31st, 2000, 12:52 PM
#18
what do you think would be better to buy?
Borland C++ builder or Borland Delphi??
I am gonna have some money available to me soon, and I want to know which is better, I think I am gonna buy C++ but I want some other opinions.
BTW Thanks for the link,
Dennis.
-
Aug 31st, 2000, 01:36 PM
#19
Monday Morning Lunatic
C++ Builder. If it was a choice of Delphi over C++, I'd choose C++ every time. Everything you can do in Delphi you can do in C++, and then some (inline asm rocks).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2000, 02:57 PM
#20
Frenzied Member
whats he url fot the platform sdk ?
-
Aug 31st, 2000, 03:31 PM
#21
Lively Member
Delphi does inline asm!
check:
function GetPortAddress(PortNo: integer): word; assembler; stdcall;
asm
push es
push ebx
mov ebx, PortNo
shl ebx,1
mov ax,40h // Dos segment adress
mov es,ax
mov ax,ES:[ebx+6] // get port adress in 16Bit way 
pop ebx
pop es
end;
-
Aug 31st, 2000, 03:36 PM
#22
Monday Morning Lunatic
Cool...
Never saw that one documented .
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|