Re: [Dev-C++] ANSI C++ forbids implicit conversion from "void*"
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Elizabeth B. <sog...@ya...> - 2002-09-30 20:22:52
|
metalseb <met...@fr...> writes:
> Compiling a small project to help one of the subscriber, I had the
> following bad surprise:
>
> I downloaded the CStaticHyperlink class from codebytes but when I try
> to compile the class, I get this message from the compiler :
>
> "ANSI C++ forbids implicit conversion from void* when passing
> parameters"
>
> The error occurs at the line where there is the CreateWindowClassEx of
> the hyperlink window control in the class constructor. I cannot
> understand what's wrong. And I cannot understand either what does this
> message tries to tell me.
>
> Anybody could help ?
You need to cast the void * when calling the function. Example:
int function(int x) {
// do something
}
int main(void) {
void * x = NULL;
// function(x); // no
function( (int) x); // okay
}
Elizabeth
|