A
amit
Hello group,
In a method of my class I have below problem in terms of type case. Can
somebody please give me insight into this?
This function returns a pointer into the array at the specified index.
Please know that the array containing image data.
void* CImageArray::ElementIndex( long iIndex) const
{
return ((unsigned char*) (void*)m_elements) + ( iIndex *
m_ElementSize);
}
Consider that m_element has a type of CMemoryBlock.
**************** Error message ***************
error C2440: 'type cast' : cannot convert from 'const class
CMemoryBlock' to 'void *'
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Error executing cl.exe.
Your help will be appreciated greatly.
Thanks,
amit
In a method of my class I have below problem in terms of type case. Can
somebody please give me insight into this?
This function returns a pointer into the array at the specified index.
Please know that the array containing image data.
void* CImageArray::ElementIndex( long iIndex) const
{
return ((unsigned char*) (void*)m_elements) + ( iIndex *
m_ElementSize);
}
Consider that m_element has a type of CMemoryBlock.
**************** Error message ***************
error C2440: 'type cast' : cannot convert from 'const class
CMemoryBlock' to 'void *'
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
Error executing cl.exe.
Your help will be appreciated greatly.
Thanks,
amit