Don't no whether to laugh

C

Catalin Pitis

JKop said:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/vccore98/HTML/_core_using_strict_type_checking.asp

Pay particular attention to:

The types WPARAM, LPARAM, LRESULT, and void * are "polymorphic data
types."


...when is Microsoft gonna cop-on?


-JKop

I don't think they referred to polymorphism from the OOP point of view. I
think that they meant that a type can have different meanings, depending on
how it is used. For example, WORD can be used as an integer value or as a
reference to an object. This can be somekind of (strange) polymorphism.

Catalin
 
C

chris

JKop said:
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/vccore98/HTML/_core_using_strict_type_checking.asp

Pay particular attention to:

The types WPARAM, LPARAM, LRESULT, and void * are “polymorphic data
types.”


...when is Microsoft gonna cop-on?


A polymorphic data type is (I would say, and first few links on google
agree) is a data type which can be store more than one kind of type.
WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

it is true that they aren't any kind of safe or typed polymorphism, but
polymorphism they are.

Perhaps you should be careful before you start insulting microsoft? (or
point to your definition of polymorphic data type?)

Chris
 
J

JKop

A polymorphic data type is (I would say, and first few links on google
agree) is a data type which can be store more than one kind of type.
WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.


A polymorphic class is a class which contains one virtual function or more.

it is true that they aren't any kind of safe or typed polymorphism, but
polymorphism they are.

Perhaps you should be careful before you start insulting microsoft? (or
point to your definition of polymorphic data type?)


Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
Open it up there and make a wizard project - all you get is C code.


-JKop
 
C

Catalin Pitis

JKop said:
A polymorphic class is a class which contains one virtual function or
more.




Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
Open it up there and make a wizard project - all you get is C code.


-JKop

You are getting religious.
 
V

Vyacheslav Kononenko

chris said:
A polymorphic data type is (I would say, and first few links on google
agree) is a data type which can be store more than one kind of type.
WPARAM, LPARAM, LRESULT and void* all seem to satisfy this requirement.

Can you make a sample of non polymorphic data type then?
it is true that they aren't any kind of safe or typed polymorphism, but
polymorphism they are.
Then everything is polymorphism more or less.
 
C

chris

Vyacheslav said:
Can you make a sample of non polymorphic data type then?

OK, these are polymorphic data types in that they are designed and
assumed to hold different types of data. The best example (void*)
satisfies this condition, a void* could be a pointer to an int* or a
char* or a big_struct*.

On the other hand, I would assume an int* just pointed to an int. (While
the c++ standard does guarantte that if you go (A*)( (void*) a ) where a
is a pointer to A is a valid thing to do, I believe it doesn't promise
you can do (A*)( (int*) a ).

Chris
 
J

JKop

Polymorphism:


Polymorphism is exhibited by a polymorphic class.

A polymorphic class is a class which contains a virtual member function.

A polymorphic class exhibits its polymorphism when a virtual member function
of its is called.

Polymorphism is the concept by which, an object which qualifies as an object
of the polymorphic class, posesses an idicator as to what exact body of code
should be executed when that particular member function is called. One
common way of achieving this is by placing a hidden pointer within the
structure of the object; this hidden pointer is used to determine what
particular body of code is to be executed when a particular member function
of its is called.


Any other definition of "polymorphism" is retarded.


-JKop
 
V

Vyacheslav Kononenko

chris said:
OK, these are polymorphic data types in that they are designed and
assumed to hold different types of data. The best example (void*)
satisfies this condition, a void* could be a pointer to an int* or a
char* or a big_struct*.

On the other hand, I would assume an int* just pointed to an int. (While
the c++ standard does guarantte that if you go (A*)( (void*) a ) where a
is a pointer to A is a valid thing to do, I believe it doesn't promise
you can do (A*)( (int*) a ).

Chris

Does C++ guarantee that long can be casted to a pointer? Will you assume
that long will keep a pointer? Was long designed to hold pointer type?
So does long satisfy this condition?
 
H

Howard

JKop said:
A polymorphic class is a class which contains one virtual function or
more.

And since when is a "data type" automatically a "class"?

They're referring to data types that can be used in multiple ways. If you've
ever used those LPARAM and WPARAM function parameter types, you'd know how
they're usually used, and can see what they mean by polymorphism. Don't get
too hung up on the C++ use of the term.
Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
Open it up there and make a wizard project - all you get is C code.

Well, technically, that's the wizard, not the compiler. You are certainly
able to "real" C++ code using Visual C++. (Well, at least if you're using
VC++7 or later.)

Not that Bill cares, eh? :)

-Howard
 
R

Reginald Blue

JKop said:
Any other definition of "polymorphism" is retarded.

I'm presuming that includes the dictionary definition:

Main Entry: poly·mor·phism
Pronunciation: "pä-lE-'mor-"fi-z&m
Function: noun
: the quality or state of being able to assume different forms: as a :
existence of a species in several forms independent of the variations of sex
b : the property of crystallizing in two or more forms with distinct
structure

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
 
S

steven11

your description is only half of the truth. the polymorphism you described
is dynamic polymorphism
which is achieved through virtual function calls in c++. but c++ also
enables you to have static
polymorphism through templates so the type is bound on compile time

i think the usage of LPARAM and so on is decisive because it's used
polymorphic. void* is - by it's nature
that it doesn't point on any type or to all types - polymorphic

mfg steven
 
S

steven11

i can't agree with you - of course you can code in c++ with vc++. i know
the vc6.0-compiler
was very very bad in standard conformity but todays ms-compilers are ok.
and if you create
a project you ain't get only c code
 
C

Chris Theis

JKop said:
Polymorphism:


Polymorphism is exhibited by a polymorphic class.

A polymorphic class is a class which contains a virtual member function.

That´s true but read your own first sentence again. It says that
polymorphism is exhibited by a polymorphic class but it does NOT say that
this is true for classes only. The original citation you gave was walking
about polymorphic data types, which does not necessarily mean classes!
A polymorphic class exhibits its polymorphism when a virtual member function
of its is called.

That´s not completely true because you omitt static polymorphism.
Polymorphism is the concept by which, an object which qualifies as an object
of the polymorphic class, posesses an idicator as to what exact body of code
should be executed when that particular member function is called. One
common way of achieving this is by placing a hidden pointer within the
structure of the object; this hidden pointer is used to determine what
particular body of code is to be executed when a particular member function
of its is called.


Any other definition of "polymorphism" is retarded.

Says who?

Cheers
Chris
 
C

Chris Theis

[SNIP]
Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
Open it up there and make a wizard project - all you get is C code.

Relax & take a deep breath. Insultation & starting a religious flame war
will bring you nowhere, and BTW there are some very gifted people working at
the aforementioned company. Furthermore nobody ever forced you to use the
wizard and to be more exact you can use "real" C++ code with Visual C++, but
(as with any decent C++ compiler) you should be able to run C code as well.
Whatever you make of it, it is up to you.

Cheers
Chris
 
A

Andrey Tarasevich

JKop said:
Polymorphism:
...
Polymorphism is exhibited by a polymorphic class.
...
Any other definition of "polymorphism" is retarded.
...

Bunch of nonsense. There is "polymorphism" as a strictly defined term in
formal C++ terminology. There's formal term "polymorphism" in biology.
There's formal term "polymorphism" in chemistry. There is finally an
English word "polymorphism". All these are very loosely related (i.e
they are related at a very abstract level). The same can be said about
many other formal C++ terms, like "aggregate", for example. For some
reason you insist on imposing the concrete formal C++ definition on all
other uses of the word. This doesn't make any sense and looks like a
troll post.
 
J

Julie

JKop said:
A polymorphic class is a class which contains one virtual function or more.

As it says in the text, and as you originally quoted, the 'polymorphism' is
with respect to a data type, not a (OO) class. There are very real differences
in meanings of the word, depending on its application.

Further, the Win32 API is a C interface, therefore such specific applications
of the C++ polymorphism term do not apply.
Microsoft deserves to be insulted. "Visual C++" is not C++ at all, it's C.
Open it up there and make a wizard project - all you get is C code.

The product is called Microsoft Visual C++, which is composed of several
components: The compiler/linker, the IDE, etc.

The wizards are strictly part of the IDE, and the code it generates has
absolutely no bearing on the underlying conformance of the C++ compiler.

You may probably want to review your original statement and revise it to
something like "Visual C++ isn't _visual_ at all", which is definitely a more
accurate analysis.

Regardless, this is all off-topic in this forum. If you have a question about
standards conformance, refer to comp.std.c++; if you have a question about the
MSVC suite, refer to microsoft.public.*.msvc and related.

Finally, what is the point of your post as it relates to the topicality of this
forum?
 
I

Ioannis Vranos

Ioannis said:
Probably you and JKop are familiar with pre-standard versions of VC++.
Check the screen-shot attached (the same applies for VC++ 2002 and 2003).


Actually VC++ 2002 lacks the RAD (more accurate terminology: the Designer).
 
I

Ioannis Vranos

JKop said:
Polymorphism:


Polymorphism is exhibited by a polymorphic class.

A polymorphic class is a class which contains a virtual member function.

A polymorphic class exhibits its polymorphism when a virtual member function
of its is called.

Polymorphism is the concept by which, an object which qualifies as an object
of the polymorphic class, posesses an idicator as to what exact body of code
should be executed when that particular member function is called. One
common way of achieving this is by placing a hidden pointer within the
structure of the object; this hidden pointer is used to determine what
particular body of code is to be executed when a particular member function
of its is called.


Any other definition of "polymorphism" is retarded.



With critical expressions aside, I guess that what the documentation you
initially mentioned means with "polymorphic types", is more accurately
generic programming. And indeed the generic programming tasks in C is
made by using void * and the appropriate casts, for example you create a
function getting void * and another type identification argument like an
int or a char * or whatever, and based on this second parameter you make
the appropriate casts and operations.


Provided that Win32 is very old (and I guess it is Win16 adapted to
Windows 9x/NT, and in this case very very old), since it is of Windows
95 time, and given that there wasn't even a C++ official standard yet,
and templates had not taken their final form (and probably not even
invented!), I guess the part of documentation you are referring to must
have been since that time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top