Hi to all ,just a small question.
When i read in the book for Win32 API tur. in c++,
this: "
cbSize
The size of the structure. "
I asked my self ,what sturcture?
I tought we useing class.

Recommended Answers

All 7 Replies

After pack of moments,my most logical conclude.
The class is extended(embodiment) structure ,so the writer is knew about that and He have a free to write this.
Am i right?

cbSize is a member of a structure that you set to the structure size before calling win32 api functions with it. For example:

struct foo
{
    unsigned int cbSize;
    // blabla
};

struct foo MyStruct;
MyStruct.cbSize = sizeof(struct foo);

>>But why they put a option with struct when they have a class?Where is advance?

win32 api is mostly written in C, not C++, so that they can be called by almost any computer language. The same functions are called by VB, assembly, C#, pascal, etc. This would not be possible if Microsoft had written the api functions in C++.

>But why they put a option with struct when they have a class?
Why not? How do you know a class was even an option?

Oh yes ,i mixed with a c++ clas.
right?

>>i mixed with a c++ clas. right?
Yup.

Thank you again for reslove my confuseing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.