PDA

Click to See Complete Forum and Search --> : Sick and Tired of not knowing it......


Aug 19th, 2000, 12:28 AM
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 :o)
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

parksie
Aug 19th, 2000, 07:09 AM
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.

Aug 19th, 2000, 10:44 AM
The full/complete PSDK is around 500MB.

Aug 19th, 2000, 12:29 PM
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
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
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
OK,
if C++ uses external library's *** language do you write those in????

parksie
Aug 20th, 2000, 04:55 AM
C++. *laughs*

They're all in C/C++, although a few deep kernel bits are probably in asm.

V(ery) Basic
Aug 20th, 2000, 05:58 AM
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 :o)
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
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..

parksie
Aug 20th, 2000, 11:09 AM
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 ;)

CthulhuDragon
Aug 21st, 2000, 12:08 PM
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
can somebody help me please?

I still dont know how to make a win32 application from scratch.......


thanks!

Dennis

parksie
Aug 21st, 2000, 01:27 PM
I'll email you my development code...it's not particularly good, but it just about works :).

Aug 21st, 2000, 02:42 PM
Cool, Thanks a lot!

parksie
Aug 21st, 2000, 03:11 PM
It's a bit buggy...

I'm still working on it. I thought I'd send it so that you could see some preliminaries

hitcgar
Aug 31st, 2000, 09:00 AM
Here's the URL for the standard C generic windows
app code:

http://msdn.microsoft.com/library/psdk/buildapp/generic_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
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.

parksie
Aug 31st, 2000, 01:36 PM
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).

PsyVision
Aug 31st, 2000, 02:57 PM
whats he url fot the platform sdk ?

hitcgar
Aug 31st, 2000, 03:31 PM
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;

parksie
Aug 31st, 2000, 03:36 PM
Never saw that one documented :(.