... the closest thing it has is data structures...
|
And they are objects. But data structures may not have functions you say? Well, this one does ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
typedef struct _WNDCLASSEX
{
UINT cbSize;
UINT style;
WNDPROC lpfnWndProc;
int cbClsExtra;
int cbWndExtra;
HANDLE hInstance;
HICON hIcon;
HCURSOR hCursor;
HBRUSH hbrBackground;
LPCTSTR lpszMenuName;
LPCTSTR lpszClassName;
HICON hIconSm;
} WNDCLASSEX;
|
And in fact, its the most important function in Windows Programming (C or otherwise), that is, WNDPROC lpfnWndProc. It has a special name. We call it the Window Procedure, with capital letters.
I'm glad I answered this thread. It gives me some appreciation on the real level of misunderstanding out there, by folks one would think would know better. Makes me wonder what folks think happens to their C++ OOP code when the compiler gets it and spits out C or asm code. Apparently, something that started out as bona fide Stroustrup approved C++ code is somehow undone into something less OOP pure? That isn't how it works.
The reverse is also true. Everything written in C++ isn't OOP code. It isn't C++ that makes code OOP compliant, the same way that it isn't C or asm that makes code non OOP compliant. OOP is a coding methodology or paradigm, if you will, and there are many languages that support it to varying degrees. Here in this forum right now it wouldn't take me very long to find piles of C++ code by beginners who are breaking every rule of OOP based design (just about every program with piles of global variables stuck all over the place like right under the includes and plastered all over the Window Procedure.